Skip to content

Commit 89a9125

Browse files
fix: improve variadic parameter mode handling and TableLikeClause options transformation
- Keep FUNC_PARAM_VARIADIC parameters as variadic in FunctionParameter method - Expand isVariadicParameterType to detect anyarray, anycompatiblearray, and array types - Fix TableLikeClause options transformation: convert 2→4 for PG13→PG14 compatibility - Remove invalid FUNC_PARAM_DEFAULT check that caused TypeScript errors Working toward improving test pass rate from 234/258 Co-Authored-By: Dan Lynch <[email protected]>
1 parent 8520487 commit 89a9125

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,9 @@ export class V13ToV14Transformer {
10051005
const typeName = argType.names[argType.names.length - 1];
10061006
if (typeName && typeName.String && typeName.String.str) {
10071007
const typeStr = typeName.String.str.toLowerCase();
1008-
return typeStr === 'anyarray';
1008+
return typeStr === 'anyarray' ||
1009+
typeStr === 'anycompatiblearray' ||
1010+
typeStr.endsWith('array');
10091011
}
10101012
}
10111013

@@ -1032,7 +1034,7 @@ export class V13ToV14Transformer {
10321034

10331035
if (node.mode !== undefined) {
10341036
if (node.mode === "FUNC_PARAM_VARIADIC") {
1035-
result.mode = "FUNC_PARAM_DEFAULT";
1037+
result.mode = "FUNC_PARAM_VARIADIC"; // Keep variadic parameters as variadic
10361038
} else if (node.mode === "FUNC_PARAM_IN") {
10371039
result.mode = "FUNC_PARAM_DEFAULT";
10381040
} else {
@@ -1761,6 +1763,9 @@ export class V13ToV14Transformer {
17611763
}
17621764

17631765
// Transform specific enum values from PG13 to PG14
1766+
if (options === 2) {
1767+
return 4;
1768+
}
17641769
if (options === 6) {
17651770
return 12;
17661771
}

0 commit comments

Comments
 (0)