Joining views together #2789
-
Let's say there are two views: employee_info, employee_time_off. Is there a way to join these two views using PostgREST using something like ? |
Beta Was this translation helpful? Give feedback.
Answered by
laurenceisla
May 25, 2023
Replies: 1 comment 5 replies
-
See https://postgrest.org/en/stable/references/api/resource_embedding.html#embedding-views |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can flatten the result with the spreading functionality in version
11.0.1
. See https://postgrest.org/en/stable/references/api/resource_embedding.html#spread-embedded-resourceThough, this only works for Many-To-One and One-To-One relationships, so you need to change the order of the embedding, which shouldn't be a problem since it would give you the same result that you mentioned in your example:
/time_off?select=*,...employee(*)