Skip to content

Commit b7dd847

Browse files
feat: add ReindexStmt transformation method
- Convert PG13's numeric options field to PG14's params array structure - Handle VERBOSE option (bit 1) conversion to DefElem format - Fixes create_index test suite - Progress: 235/258 passing tests (+1 improvement) Co-Authored-By: Dan Lynch <[email protected]>
1 parent c34d99d commit b7dd847

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2842,4 +2842,38 @@ export class V13ToV14Transformer {
28422842
return { AlterObjectSchemaStmt: result };
28432843
}
28442844

2845+
ReindexStmt(node: any, context: TransformerContext): any {
2846+
const result: any = {};
2847+
2848+
if (node.kind !== undefined) {
2849+
result.kind = node.kind;
2850+
}
2851+
2852+
if (node.relation !== undefined) {
2853+
result.relation = this.transform(node.relation as any, context);
2854+
}
2855+
2856+
if (node.name !== undefined) {
2857+
result.name = node.name;
2858+
}
2859+
2860+
// Transform PG13's numeric options to PG14's params array
2861+
if (node.options !== undefined) {
2862+
const params = [];
2863+
2864+
if (node.options & 1) {
2865+
params.push({
2866+
DefElem: {
2867+
defname: "verbose",
2868+
defaction: "DEFELEM_UNSPEC"
2869+
}
2870+
});
2871+
}
2872+
2873+
result.params = params;
2874+
}
2875+
2876+
return { ReindexStmt: result };
2877+
}
2878+
28452879
}

0 commit comments

Comments
 (0)