Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostgREST compatible computed relationships #349

Merged
merged 14 commits into from
May 15, 2023
Merged

Conversation

olirice
Copy link
Contributor

@olirice olirice commented Apr 20, 2023

What kind of change does this PR introduce?

WIP Adding support for PostgREST style computed relationships

For example:

create or replace function public.computed_books(rec public.account)
	returns setof book
	immutable
	strict
	language sql
as $$
	select * from book where book.author_id = rec.id
$$;

TODO:

  • tests
  • handle anonymous tables in some way (make them work or raise an error)
  • handle returns setoff <entity> rows 1 as to-one not to-many
  • document preference for returns setoff <entity> rows 1 for inlining
  • update the computed relationship docs

resolves #357

@olirice olirice marked this pull request as ready for review May 3, 2023 15:02
@olirice olirice merged commit 0c1af75 into master May 15, 2023
@olirice olirice deleted the or/table_functions branch May 15, 2023 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filtering on Computed Columns
2 participants