Skip to content

Commit 1a7f496

Browse files
Fix CreateTransformStmt objfuncargs creation by wrapping fromsql/tosql as ObjectWithArgs
- Explicitly wrap fromsql and tosql properties in ObjectWithArgs wrapper before transformation - Follows same pattern as CreateCastStmt for proper objfuncargs generation - Fixes object_address test that was missing objfuncargs in CreateTransformStmt contexts - Current status: 237/258 tests passing (91.9%) Co-Authored-By: Dan Lynch <[email protected]>
1 parent ad363a1 commit 1a7f496

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/transform/src/transformers/v13-to-v14.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,11 +1854,15 @@ export class V13ToV14Transformer {
18541854
}
18551855

18561856
if (node.fromsql !== undefined) {
1857-
result.fromsql = this.transform(node.fromsql as any, childContext);
1857+
const wrappedFromsql = { ObjectWithArgs: node.fromsql };
1858+
const transformedFromsql = this.transform(wrappedFromsql as any, childContext);
1859+
result.fromsql = transformedFromsql.ObjectWithArgs;
18581860
}
18591861

18601862
if (node.tosql !== undefined) {
1861-
result.tosql = this.transform(node.tosql as any, childContext);
1863+
const wrappedTosql = { ObjectWithArgs: node.tosql };
1864+
const transformedTosql = this.transform(wrappedTosql as any, childContext);
1865+
result.tosql = transformedTosql.ObjectWithArgs;
18621866
}
18631867

18641868
if (node.replace !== undefined) {
@@ -1993,7 +1997,7 @@ export class V13ToV14Transformer {
19931997
const originalObjfuncargs = (node as any).objfuncargs;
19941998

19951999
// Don't create objfuncargs in certain contexts where they shouldn't exist
1996-
const skipObjfuncargsContexts = ['CreateTransformStmt'];
2000+
const skipObjfuncargsContexts: string[] = [];
19972001
const shouldSkipObjfuncargs = skipObjfuncargsContexts.some(ctx => context.parentNodeTypes?.includes(ctx));
19982002

19992003
if (originalObjfuncargs && Array.isArray(originalObjfuncargs)) {

0 commit comments

Comments
 (0)