Skip to content

refactor(core): drop verify_schema from the schema-name literal pass - #1674

Open
pyramation wants to merge 1 commit into
mainfrom
feat/drop-verify-schema-literal-pass
Open

refactor(core): drop verify_schema from the schema-name literal pass#1674
pyramation wants to merge 1 commit into
mainfrom
feat/drop-verify-schema-literal-pass

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

SCHEMA_NAME_LITERAL_FUNCS (duplicated in apply/materialize.ts and apply/reuse.ts) loses its verify_schema entry:

-const SCHEMA_NAME_LITERAL_FUNCS = ['verify_schema', 'has_schema_privilege'];
+const SCHEMA_NAME_LITERAL_FUNCS = ['has_schema_privilege'];

verify_schema no longer exists — constructive-db now emits assert_schema('sch'::regnamespace), and @pgsql/transform routes 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 (transformVerifyCalls is 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 on Failed 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

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.
@pyramation pyramation self-assigned this Aug 6, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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