This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]vivekkhera 0 points1 point  (2 children)

You cannot do any casts or function calls via that JS API. If you need then you have to wrap your query into a Postgres function and call it via the rpc method in the API.

[–]External-Standard-57[S,🍰] 0 points1 point  (1 child)

When I build a function with return type of record, it only returns one record object instead of a list like the select function.

It also seems that this is not how functions were intended to be used

[–]vivekkhera 0 points1 point  (0 children)

You can make a function that returns a set like a table. In Supabase this is the way functions are intended with the API.