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

fix(typegen): don't generate relationships across schemas #809

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

soedirgo
Copy link
Member

@soedirgo soedirgo commented Oct 9, 2024

PostgREST doesn't detect relationships across schemas

PostgREST doesn't detect relationships across schemas
Copy link

@avallete avallete left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, maybe we'll want this not only in typescript tough. So maybe some filter at relation fetching level 🤔

Also, I wonder if that make sense for postgres-meta to not handle cross-schemas relations. PostgREST might not handle it, but postgres itself does.

@soedirgo
Copy link
Member Author

soedirgo commented Oct 9, 2024

maybe we'll want this not only in typescript tough. So maybe some filter at relation fetching level

IIRC these are used by the dashboard to detect fkeys across schemas, so we need to keep it as is.

I wonder if that make sense for postgres-meta to not handle cross-schemas relations. PostgREST might not handle it, but postgres itself does.

The typegen is designed with PostgREST use case in mind, although it's not documented as such - we may want to make this explicit at some point though (e.g. rename the route to postgrest-types/typescript)

@soedirgo soedirgo merged commit 2e54f31 into master Oct 9, 2024
4 checks passed
@soedirgo soedirgo deleted the fix/typegen-relationships-across-schemas branch October 9, 2024 20:13
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.

2 participants