Skip to content

Commit 14cebfb

Browse files
fix: remove all JSON pg_catalog prefix logic from TypeName and TypeCast methods
- Simplified both methods to basic pass-through transformations - Current status: 250/258 tests passing (8 failures remaining) - Ready to implement targeted JSON prefix logic for specific contexts Co-Authored-By: Dan Lynch <[email protected]>
1 parent f750f67 commit 14cebfb

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

packages/transform/src/transformers/v16-to-v17.ts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -454,27 +454,9 @@ export class V16ToV17Transformer {
454454
const result: any = {};
455455

456456
if (node.names !== undefined) {
457-
let names = Array.isArray(node.names)
457+
result.names = Array.isArray(node.names)
458458
? node.names.map(item => this.transform(item as any, context))
459459
: this.transform(node.names as any, context);
460-
461-
if (Array.isArray(names) && names.length === 1) {
462-
const firstElement = names[0];
463-
if (firstElement && typeof firstElement === 'object' && 'String' in firstElement) {
464-
const typeNameStr = firstElement.String.str || firstElement.String.sval;
465-
if (typeNameStr === 'json' || typeNameStr === 'jsonb') {
466-
// Add pg_catalog prefix
467-
const pgCatalogElement = {
468-
String: {
469-
sval: 'pg_catalog'
470-
}
471-
};
472-
names = [pgCatalogElement, firstElement];
473-
}
474-
}
475-
}
476-
477-
result.names = names;
478460
}
479461

480462
if (node.typeOid !== undefined) {

0 commit comments

Comments
 (0)