supabase / postgres-meta

A RESTful API for managing your Postgres. Fetch tables, add roles, and run queries
https://supabase.com
Apache License 2.0
941 stars 126 forks source link

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

Closed soedirgo closed 1 month ago

soedirgo commented 1 month ago

PostgREST doesn't detect relationships across schemas

soedirgo commented 1 month ago

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)