refactor(core): drop verify_schema from the schema-name literal pass - #1674
Open
pyramation wants to merge 1 commit into
Open
refactor(core): drop verify_schema from the schema-name literal pass#1674pyramation wants to merge 1 commit into
pyramation wants to merge 1 commit into
Conversation
verify_schema is gone from pgpm-verify: bare schema identities are now
assert_schema('sch'::regnamespace), which the AST identity-cast routing
renames. has_schema_privilege stays -- it genuinely takes a bare schema name
as a string literal and nothing else can reach it.
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or 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
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.
Summary
SCHEMA_NAME_LITERAL_FUNCS(duplicated inapply/materialize.tsandapply/reuse.ts) loses itsverify_schemaentry:verify_schemano longer exists — constructive-db now emitsassert_schema('sch'::regnamespace), and@pgsql/transformroutes identity casts by cast type, so the bare-name case the pre-pass existed for is handled by the AST walk. This is the pgpm half of removing the two parallel helper-name lists (transformVerifyCallsis the other, constructive-io/pgsql-parser#344).I did not delete the pass outright, which was the original plan:
has_schema_privilege('users', 'usage')really does take a bare schema name in a string literal (the apply fixtures use it), and nothing in the AST pass can reach it. Removing it made all five apply e2e suites fail onFailed to verify schemas/tenant_a/schema. The hazard worth removing was the verify-helper list that had to be extended per helper; a single Postgres builtin is not that.Validation
pgpm/core: 489 tests / 77 suites passing (the five apply e2e suites exercise this pass)Link to Devin session: https://app.devin.ai/sessions/37a60838adfb4fd6ac8c29f09c2e2827
Requested by: @pyramation