how to change return table (array of records) in rpc? #5008
Unanswered
tatiana1337
asked this question in
Questions
Replies: 2 comments 1 reply
|
Hi @tatiana1337 ! Did you create the SQL function with raw SQL or from the Supabase console? Do you happen to have the definition of your |
1 reply
|
The function should be declared with create or replace function get_posts() returns setof posts as $$
select * from posts
$$ language sql |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
which return type should I choose to get array of records (table) from rpc?
this block of code returns only 1 single record from table posts
SELECT * from postsAll reactions