-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
OpenAPI description foreign key description: schema missing #1874
Comments
This is true, but we don't allow cross-schema resource embedding. We send a |
Hello Steve, When I download the OpenAPI spec for schema A, it will contain column descriptions like
These lines also occur for tables outside schema A. But how can I tell in what schema I can find the table "tablename"? |
We had a discussion about foreign keys over here: #1794 (comment) We didn't change anything in the OpenAPI output, yet, but I assume we will not show any FKs that target other schemas at all down the road. At that point you can safely assume that any FK targets a table in the currently queried schema. Therefore, I'd consider this a bug right now. |
Well, er... I'm currently relying on what you consider a "bug", so please do not remove that feature (?) |
Are you relying on the whole I consider the 2nd one a bug, not the first. |
Well, both. I don't have all my database objects in one single schema, but structured into multiple schemas. |
So do I. But I fail to understand the value in having |
Well, my table A in schema A has as a foreign key the primary key of table B in schema B. Both tables and schemas are exposed - but the tables are in different schemas. My client software uses the postgrest meta information, especially the fk relationships. For example, when editing table A, the foreign key is displayed as a dropdown of table B records. The described relation between tables of different schemas is currently present in postgrest, but lacks schema information, as discussed. |
So you are accessing those different schemas via the |
Correct. (Or is there an alternative way?) |
While this is not documented explicitely, yet, I understand our approach of Schema Isolation to not only isolate the public schema from private/hidden schemas - but also to isolate different public schemas from each other. The |
Thank you for your detailed answer. I still would be interested in being able to split my database in separate parts, or schemas, for a better overview. |
Meanwhile I have migrated away from using the postgrest OpenAPI spec. I'm now using my own "meta-model", built as a PostgreSQL view, heavily using pg_catalog tables. I am now more flexible with this approach. My FK-relationships across schemas are now expressed by the latter. |
Environment
Description of issue
Preface
Foreign Keys to other schemas are valid, and other schemas can be queried by PostgREST, see https://postgrest.org/en/stable/api.html?highlight=openapi#switching-schemas .
Problem
The OpenAPI description contains in
definitions.tablename.properties.columnname
information on foreign keys:What I am missing is the schema name (if this foreign key points to a table in another schema).
Could this be added? Thank you.
The text was updated successfully, but these errors were encountered: