Resource embedding on an RPC function #4648
Unanswered
BorislavZlatanov
asked this question in
Q&A
Replies: 1 comment
-
|
@BorislavZlatanov Change the return type from |
Beta Was this translation helpful? Give feedback.
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.
-
I have an RPC function endpoint that looks like this (simplified):
I want to do a JOIN with another table in order to filter the results based on a column from that other table.
The docs on Resource Embedding state that "For table-valued functions, it generates a join condition based on the foreign key columns of the returned table type". But I don't exactly understand what this means (what foreign key columns are in this context).
I tried the obvious thing with
https://localhost/rpc/poll?select=post_title,poll_choices(id)i.e. I tried to join a
poll_choicestable which has a foreign key but this foreign key is to another table, not to the table returned by the function. So I got the errorCould not find a relationship between 'record' and 'poll_choices' in the schema cacheHow can I accomplish my objective?
Beta Was this translation helpful? Give feedback.
All reactions