diff --git a/pgpm/core/src/apply/materialize.ts b/pgpm/core/src/apply/materialize.ts index 8f9c96178..5d527749f 100644 --- a/pgpm/core/src/apply/materialize.ts +++ b/pgpm/core/src/apply/materialize.ts @@ -26,11 +26,10 @@ export interface MaterializeApplyOptions { outDir?: string; } -// Functions that take a bare schema name as a string-literal first argument. -// The AST pass only remaps dotted literals ('schema.object'); these helpers -// (ubiquitous in verify scripts) name the schema alone, so a string-level -// pre-pass remaps them. -const SCHEMA_NAME_LITERAL_FUNCS = ['verify_schema', 'has_schema_privilege']; +// has_schema_privilege takes a bare schema name as a string literal. The AST +// pass only remaps dotted literals ('schema.object') and identity casts +// ('schema'::regnamespace), so this one is remapped by a string pre-pass. +const SCHEMA_NAME_LITERAL_FUNCS = ['has_schema_privilege']; const schemaNameLiteralPass: SchemaTransformPass = (content, schemaMapping) => { const pattern = new RegExp( diff --git a/pgpm/core/src/apply/reuse.ts b/pgpm/core/src/apply/reuse.ts index 5ecb35cc3..2244fd4a4 100644 --- a/pgpm/core/src/apply/reuse.ts +++ b/pgpm/core/src/apply/reuse.ts @@ -38,9 +38,11 @@ const FOLDER_KIND: Record = { types: 'type' }; -// Mirrors materialize.ts: bare-schema-name literal helpers the AST pass can't -// reach are remapped by a narrow string pre-pass. -const SCHEMA_NAME_LITERAL_FUNCS = ['verify_schema', 'has_schema_privilege']; +// Mirrors materialize.ts. +// has_schema_privilege takes a bare schema name as a string literal. The AST +// pass only remaps dotted literals ('schema.object') and identity casts +// ('schema'::regnamespace), so this one is remapped by a string pre-pass. +const SCHEMA_NAME_LITERAL_FUNCS = ['has_schema_privilege']; const schemaNameLiteralPass: SchemaTransformPass = (content, schemaMapping) => { const pattern = new RegExp( `\\b(${SCHEMA_NAME_LITERAL_FUNCS.join('|')})\\s*\\(\\s*'([^']+)'`,