-
Notifications
You must be signed in to change notification settings - Fork 1
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
Only get types and procedures from unqualified schemas #271
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`generate-chinook-configuration.sh` used to use `new-configuration.sh`, which unconditionally uses the defaults from the latest version.
As an auxiliary improvement, use the `regclass` etc. types to refer to catalog table entries instead of hardcoding oids. Incidentally this fixes fetching of table and column comments on Cockroach.
soupi
reviewed
Jan 31, 2024
soupi
reviewed
Jan 31, 2024
soupi
reviewed
Jan 31, 2024
Co-authored-by: Gil Mizrahi <[email protected]>
Co-authored-by: Gil Mizrahi <[email protected]>
soupi
reviewed
Jan 31, 2024
// weirdly, we have to use 'skip_serializing_if' rather than 'skip_serializing', since the | ||
// latter causes schemars to consider the field required, in spite of the 'default' attribute. | ||
#[serde(skip_serializing_if = "always_skip_unqualified_schemas")] | ||
pub unqualified_schemas: Vec<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please document the relationship between this field and the others? What happens if this field and the others are defined?
soupi
reviewed
Jan 31, 2024
Co-authored-by: Gil Mizrahi <[email protected]>
soupi
approved these changes
Jan 31, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
In order to be able to unambiguously refer to types and procedures (i.e to avoid an issue like hasura/graphql-engine#10100) we want to be sure that we track the schema types and procedures are defined in, similar to how we do tables.
This PR implements a minimal first step on the way to this, by simply only tracking types and procedures defined in schemas appearing in a new
unqualifiedSchemasForTypesAndProcedures
configuration option.It is then up to a follow-up PR to implement schema name prefixing.
(Small aside: As an auxiliary improvement, thi PR introduces the use of the
regclass
etc. types to refer to catalog table entries instead of hardcoding oids. Incidentally this fixes fetching of table and column comments on Cockroach.)How
We add a new configuration option field
unqualifiedSchemasForTypesAndProcedures
that defaults to["public","pg_catalog","tiger"]
. During introspection we only look in these schemas for types and procedures.For consistency we also rename
unqualifiedSchemas
tounqualifiedSchemasForTables
. In order to make this change conservative we still recognizeunqualifiedSchemas
in the API schema and json parsers, but we will only ever outputunqualifiedSchemasForTables
from the configuration server.