Open davidfant opened 3 months ago
Hey,
The runtime error is expected I think AFAIK postgrest need a function that return a setof
to know it map to another table:
However, I think the types will still have troubles with this because some more work is required to support rpc
call embedding typing (see: https://github.com/supabase/postgrest-js/compare/d52234f5c74318351be999d1a0d6273353335653..c6c279564321febd910de52fb326b3b8f5e7d635#diff-58acaadb1530eeb222dd2a23a57bbe8e426aca227f2f1843d29fe2fe9f5e1ee2L75-L134)
So you should be able to achieve what you want by making your function return a SETOF
, however, you will need to manually override the select result with returns
for now.
Bug report
Describe the bug
I'm getting errors when joining relationships from rpc function calls, but the supabase-js SDK infers the correct types (suggesting it is possible)
To Reproduce
I have a Postgres function
This performs a complex filter and returns a list of triggerIds, which map to the
triggers
table. To fetch this I'm doing:When I write the following, supabase-js type inference correctly shows me the right types
However that query doesn't work and gives the following error:
Expected behavior
The trigger table is joined and in the
select
statement I can join arbitrary fields and relationshipsSystem information