Skip to content

Commit 2b8f98d

Browse files
committed
fix: remove functionResourceName override per user request - keep all names flat
1 parent a4d7028 commit 2b8f98d

1 file changed

Lines changed: 0 additions & 33 deletions

File tree

graphile/graphile-settings/src/plugins/custom-inflector.ts

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -129,39 +129,6 @@ export const InflektPlugin: GraphileConfig.Plugin = {
129129
return '';
130130
},
131131

132-
/**
133-
* Restore PostGraphile's default schema prefix logic for functions.
134-
*
135-
* Our _schemaPrefix override returns '' for all schemas to give clean
136-
* table names. However, this strips prefixes from functions too, causing
137-
* resource naming collisions when a function and table share the same
138-
* base name across schemas (e.g., actions_public.table_grant() collides
139-
* with metaschema_public.table_grant table).
140-
*
141-
* Fix: bypass our _schemaPrefix override for functions and use
142-
* PostGraphile's default prefix logic instead.
143-
*/
144-
functionResourceName(_previous, options: any, details: any) {
145-
const { serviceName, pgProc } = details;
146-
const { tags } = pgProc.getTagsAndDescription();
147-
148-
if (typeof tags.name === 'string') {
149-
return tags.name;
150-
}
151-
152-
const pgNamespace = pgProc.getNamespace();
153-
154-
if (!pgNamespace) {
155-
return pgProc.proname;
156-
}
157-
158-
const pgService = (options.pgServices ?? []).find((db: any) => db.name === serviceName);
159-
const primarySchema = pgService?.schemas?.[0] ?? 'public';
160-
const databasePrefix = serviceName === 'main' ? '' : `${serviceName}_`;
161-
const schemaPrefix = pgNamespace.nspname === primarySchema ? '' : `${pgNamespace.nspname}_`;
162-
return `${databasePrefix}${schemaPrefix}${pgProc.proname}`;
163-
},
164-
165132
/**
166133
* Keep `id` columns as `id` instead of renaming to `rowId`.
167134
*

0 commit comments

Comments
 (0)