pgsql-deparser 13.16.0 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +88 -45
  2. package/dist/README.md +160 -0
  3. package/dist/deparser/deparser.d.ts +301 -0
  4. package/dist/deparser/deparser.js +10005 -0
  5. package/dist/deparser/index.d.ts +9 -0
  6. package/dist/deparser/index.js +17 -0
  7. package/dist/deparser/utils/list-utils.d.ts +8 -0
  8. package/dist/deparser/utils/list-utils.js +30 -0
  9. package/dist/deparser/utils/quote-utils.d.ts +24 -0
  10. package/dist/deparser/utils/quote-utils.js +89 -0
  11. package/dist/deparser/utils/sql-formatter.d.ts +16 -0
  12. package/dist/deparser/utils/sql-formatter.js +40 -0
  13. package/dist/deparser/visitors/base.d.ts +21 -0
  14. package/dist/deparser/visitors/base.js +34 -0
  15. package/dist/esm/deparser/deparser.js +10001 -0
  16. package/dist/esm/deparser/index.js +13 -0
  17. package/dist/esm/deparser/utils/list-utils.js +26 -0
  18. package/dist/esm/deparser/utils/quote-utils.js +85 -0
  19. package/dist/esm/deparser/utils/sql-formatter.js +36 -0
  20. package/dist/esm/deparser/visitors/base.js +30 -0
  21. package/dist/esm/index.js +15 -0
  22. package/dist/esm/v14-to-v15.js +1220 -0
  23. package/dist/esm/v14-to-v17-direct.js +67 -0
  24. package/dist/esm/v15-to-v16.js +2881 -0
  25. package/dist/esm/v16-to-v17.js +1488 -0
  26. package/dist/index.d.ts +9 -0
  27. package/dist/index.js +19 -0
  28. package/dist/package.json +42 -0
  29. package/dist/v14-to-v15.d.ts +616 -0
  30. package/dist/v14-to-v15.js +1224 -0
  31. package/dist/v14-to-v17-direct.d.ts +23 -0
  32. package/dist/v14-to-v17-direct.js +71 -0
  33. package/dist/v15-to-v16.d.ts +627 -0
  34. package/dist/v15-to-v16.js +2885 -0
  35. package/dist/v16-to-v17.d.ts +638 -0
  36. package/dist/v16-to-v17.js +1492 -0
  37. package/package.json +27 -75
  38. package/src/deparser/deparser.ts +10026 -0
  39. package/src/deparser/index.ts +14 -0
  40. package/src/deparser/utils/list-utils.ts +27 -0
  41. package/src/deparser/utils/quote-utils.ts +86 -0
  42. package/src/deparser/utils/sql-formatter.ts +37 -0
  43. package/src/deparser/visitors/base.ts +40 -0
  44. package/src/index.ts +27 -3
  45. package/src/v14-to-v15.ts +1621 -0
  46. package/src/v14-to-v17-direct.ts +68 -0
  47. package/src/v15-to-v16.ts +3290 -0
  48. package/src/v16-to-v17.ts +1897 -0
  49. package/tsconfig.esm.json +8 -0
  50. package/tsconfig.json +26 -0
  51. package/main/deparser.js +0 -3495
  52. package/main/index.js +0 -10
  53. package/main/utils/index.js +0 -97
  54. package/module/deparser.js +0 -3492
  55. package/module/index.js +0 -3
  56. package/module/utils/index.js +0 -90
  57. package/src/deparser.ts +0 -4234
  58. package/src/utils/index.ts +0 -92
  59. package/types/deparser.d.ts +0 -119
  60. package/types/index.d.ts +0 -3
  61. package/types/utils/index.d.ts +0 -4
  62. /package/{LICENSE → dist/LICENSE} +0 -0
@@ -0,0 +1,3290 @@
1
+ /**
2
+ * Auto-generated file with types stripped for better tree-shaking
3
+ * DO NOT EDIT - Generated by strip-transformer-types.ts
4
+ */
5
+
6
+ // @ts-nocheck
7
+ /**
8
+ * V15 to V16 AST Transformer
9
+ * Transforms PostgreSQL v15 AST nodes to v16 format
10
+ */
11
+ export class V15ToV16Transformer {
12
+ transform(node: any, context: any = { parentNodeTypes: [] }): any {
13
+ if (node == null) {
14
+ return null;
15
+ }
16
+ if (typeof node === 'number' || node instanceof Number) {
17
+ return node;
18
+ }
19
+ if (typeof node === 'string') {
20
+ return node;
21
+ }
22
+ if (Array.isArray(node)) {
23
+ return node.map(item => this.transform(item, context));
24
+ }
25
+ try {
26
+ return this.visit(node, context);
27
+ }
28
+ catch (error) {
29
+ const nodeType = Object.keys(node)[0];
30
+ throw new Error(`Error transforming ${nodeType}: ${(error as Error).message}`);
31
+ }
32
+ }
33
+ visit(node: any, context: any = { parentNodeTypes: [] }): any {
34
+ const nodeType = this.getNodeType(node);
35
+ // Handle empty objects
36
+ if (!nodeType) {
37
+ return {};
38
+ }
39
+ const nodeData = this.getNodeData(node);
40
+ const methodName = nodeType as keyof this;
41
+ if (typeof this[methodName] === 'function') {
42
+ const childContext: any = {
43
+ ...context,
44
+ parentNodeTypes: [...(context.parentNodeTypes || []), nodeType]
45
+ };
46
+ return (this[methodName] as any)(nodeData, childContext);
47
+ }
48
+ // If no specific method, return the node as-is
49
+ return node;
50
+ }
51
+ getNodeType(node: any): any {
52
+ const keys = Object.keys(node);
53
+ // Handle parse result structure with version and stmts
54
+ if (keys.length === 2 && keys.includes('version') && keys.includes('stmts')) {
55
+ return 'ParseResult';
56
+ }
57
+ return keys[0];
58
+ }
59
+ getNodeData(node: any): any {
60
+ const keys = Object.keys(node);
61
+ if (keys.length === 1 && typeof (node as any)[keys[0]] === 'object') {
62
+ return (node as any)[keys[0]];
63
+ }
64
+ return node;
65
+ }
66
+ ParseResult(node: any, context: any): any {
67
+ if (node && typeof node === 'object' && 'version' in node && 'stmts' in node) {
68
+ return {
69
+ version: 160000, // PG16 version
70
+ stmts: node.stmts.map((stmt: any) => {
71
+ if (stmt && typeof stmt === 'object' && 'stmt' in stmt) {
72
+ return {
73
+ ...stmt,
74
+ stmt: this.transform(stmt.stmt, context)
75
+ };
76
+ }
77
+ return this.transform(stmt, context);
78
+ })
79
+ };
80
+ }
81
+ return node as any;
82
+ }
83
+ RawStmt(node: any, context: any): {
84
+ RawStmt: any;
85
+ } {
86
+ const result: any = {};
87
+ if (node.stmt !== undefined) {
88
+ result.stmt = this.transform(node.stmt as any, context);
89
+ }
90
+ if (node.stmt_location !== undefined) {
91
+ result.stmt_location = node.stmt_location;
92
+ }
93
+ if (node.stmt_len !== undefined) {
94
+ result.stmt_len = node.stmt_len;
95
+ }
96
+ return { RawStmt: result };
97
+ }
98
+ SelectStmt(node: any, context: any): {
99
+ SelectStmt: any;
100
+ } {
101
+ const result: any = {};
102
+ if (node.distinctClause !== undefined) {
103
+ result.distinctClause = Array.isArray(node.distinctClause)
104
+ ? node.distinctClause.map((item: any) => this.transform(item as any, context))
105
+ : this.transform(node.distinctClause as any, context);
106
+ }
107
+ if (node.intoClause !== undefined) {
108
+ result.intoClause = this.transform(node.intoClause as any, context);
109
+ }
110
+ if (node.targetList !== undefined) {
111
+ result.targetList = Array.isArray(node.targetList)
112
+ ? node.targetList.map((item: any) => this.transform(item as any, context))
113
+ : this.transform(node.targetList as any, context);
114
+ }
115
+ if (node.fromClause !== undefined) {
116
+ result.fromClause = Array.isArray(node.fromClause)
117
+ ? node.fromClause.map((item: any) => this.transform(item as any, context))
118
+ : this.transform(node.fromClause as any, context);
119
+ }
120
+ if (node.whereClause !== undefined) {
121
+ result.whereClause = this.transform(node.whereClause as any, context);
122
+ }
123
+ if (node.groupClause !== undefined) {
124
+ result.groupClause = Array.isArray(node.groupClause)
125
+ ? node.groupClause.map((item: any) => this.transform(item as any, context))
126
+ : this.transform(node.groupClause as any, context);
127
+ }
128
+ if (node.groupDistinct !== undefined) {
129
+ result.groupDistinct = node.groupDistinct;
130
+ }
131
+ if (node.havingClause !== undefined) {
132
+ result.havingClause = this.transform(node.havingClause as any, context);
133
+ }
134
+ if (node.windowClause !== undefined) {
135
+ result.windowClause = Array.isArray(node.windowClause)
136
+ ? node.windowClause.map((item: any) => this.transform(item as any, context))
137
+ : this.transform(node.windowClause as any, context);
138
+ }
139
+ if (node.valuesLists !== undefined) {
140
+ result.valuesLists = Array.isArray(node.valuesLists)
141
+ ? node.valuesLists.map((item: any) => this.transform(item as any, context))
142
+ : this.transform(node.valuesLists as any, context);
143
+ }
144
+ if (node.sortClause !== undefined) {
145
+ result.sortClause = Array.isArray(node.sortClause)
146
+ ? node.sortClause.map((item: any) => this.transform(item as any, context))
147
+ : this.transform(node.sortClause as any, context);
148
+ }
149
+ if (node.limitOffset !== undefined) {
150
+ result.limitOffset = this.transform(node.limitOffset as any, context);
151
+ }
152
+ if (node.limitCount !== undefined) {
153
+ result.limitCount = this.transform(node.limitCount as any, context);
154
+ }
155
+ if (node.limitOption !== undefined) {
156
+ result.limitOption = node.limitOption;
157
+ }
158
+ if (node.lockingClause !== undefined) {
159
+ result.lockingClause = Array.isArray(node.lockingClause)
160
+ ? node.lockingClause.map((item: any) => this.transform(item as any, context))
161
+ : this.transform(node.lockingClause as any, context);
162
+ }
163
+ if (node.withClause !== undefined) {
164
+ result.withClause = this.transform(node.withClause as any, context);
165
+ }
166
+ if (node.op !== undefined) {
167
+ result.op = node.op;
168
+ }
169
+ if (node.all !== undefined) {
170
+ result.all = node.all;
171
+ }
172
+ if (node.larg !== undefined) {
173
+ result.larg = this.transform(node.larg as any, context);
174
+ }
175
+ if (node.rarg !== undefined) {
176
+ result.rarg = this.transform(node.rarg as any, context);
177
+ }
178
+ return { SelectStmt: result };
179
+ }
180
+ A_Expr(node: any, context: any): {
181
+ A_Expr: any;
182
+ } {
183
+ const result: any = {};
184
+ if (node.kind !== undefined) {
185
+ result.kind = node.kind;
186
+ }
187
+ if (node.name !== undefined) {
188
+ result.name = Array.isArray(node.name)
189
+ ? node.name.map((item: any) => this.transform(item as any, context))
190
+ : this.transform(node.name as any, context);
191
+ }
192
+ if (node.lexpr !== undefined) {
193
+ result.lexpr = this.transform(node.lexpr as any, context);
194
+ }
195
+ if (node.rexpr !== undefined) {
196
+ result.rexpr = this.transform(node.rexpr as any, context);
197
+ }
198
+ if (node.location !== undefined) {
199
+ result.location = node.location;
200
+ }
201
+ return { A_Expr: result };
202
+ }
203
+ InsertStmt(node: any, context: any): {
204
+ InsertStmt: any;
205
+ } {
206
+ const result: any = {};
207
+ if (node.relation !== undefined) {
208
+ result.relation = this.transform(node.relation as any, context);
209
+ }
210
+ if (node.cols !== undefined) {
211
+ result.cols = Array.isArray(node.cols)
212
+ ? node.cols.map((item: any) => this.transform(item as any, context))
213
+ : this.transform(node.cols as any, context);
214
+ }
215
+ if (node.selectStmt !== undefined) {
216
+ result.selectStmt = this.transform(node.selectStmt as any, context);
217
+ }
218
+ if (node.onConflictClause !== undefined) {
219
+ result.onConflictClause = this.transform(node.onConflictClause as any, context);
220
+ }
221
+ if (node.returningList !== undefined) {
222
+ result.returningList = Array.isArray(node.returningList)
223
+ ? node.returningList.map((item: any) => this.transform(item as any, context))
224
+ : this.transform(node.returningList as any, context);
225
+ }
226
+ if (node.withClause !== undefined) {
227
+ result.withClause = this.transform(node.withClause as any, context);
228
+ }
229
+ if (node.override !== undefined) {
230
+ result.override = node.override;
231
+ }
232
+ return { InsertStmt: result };
233
+ }
234
+ UpdateStmt(node: any, context: any): {
235
+ UpdateStmt: any;
236
+ } {
237
+ const result: any = {};
238
+ if (node.relation !== undefined) {
239
+ result.relation = this.transform(node.relation as any, context);
240
+ }
241
+ if (node.targetList !== undefined) {
242
+ result.targetList = Array.isArray(node.targetList)
243
+ ? node.targetList.map((item: any) => this.transform(item as any, context))
244
+ : this.transform(node.targetList as any, context);
245
+ }
246
+ if (node.whereClause !== undefined) {
247
+ result.whereClause = this.transform(node.whereClause as any, context);
248
+ }
249
+ if (node.fromClause !== undefined) {
250
+ result.fromClause = Array.isArray(node.fromClause)
251
+ ? node.fromClause.map((item: any) => this.transform(item as any, context))
252
+ : this.transform(node.fromClause as any, context);
253
+ }
254
+ if (node.returningList !== undefined) {
255
+ result.returningList = Array.isArray(node.returningList)
256
+ ? node.returningList.map((item: any) => this.transform(item as any, context))
257
+ : this.transform(node.returningList as any, context);
258
+ }
259
+ if (node.withClause !== undefined) {
260
+ result.withClause = this.transform(node.withClause as any, context);
261
+ }
262
+ return { UpdateStmt: result };
263
+ }
264
+ DeleteStmt(node: any, context: any): {
265
+ DeleteStmt: any;
266
+ } {
267
+ const result: any = {};
268
+ if (node.relation !== undefined) {
269
+ result.relation = this.transform(node.relation as any, context);
270
+ }
271
+ if (node.usingClause !== undefined) {
272
+ result.usingClause = Array.isArray(node.usingClause)
273
+ ? node.usingClause.map((item: any) => this.transform(item as any, context))
274
+ : this.transform(node.usingClause as any, context);
275
+ }
276
+ if (node.whereClause !== undefined) {
277
+ result.whereClause = this.transform(node.whereClause as any, context);
278
+ }
279
+ if (node.returningList !== undefined) {
280
+ result.returningList = Array.isArray(node.returningList)
281
+ ? node.returningList.map((item: any) => this.transform(item as any, context))
282
+ : this.transform(node.returningList as any, context);
283
+ }
284
+ if (node.withClause !== undefined) {
285
+ result.withClause = this.transform(node.withClause as any, context);
286
+ }
287
+ return { DeleteStmt: result };
288
+ }
289
+ WithClause(node: any, context: any): {
290
+ WithClause: any;
291
+ } {
292
+ const result: any = {};
293
+ if (node.ctes !== undefined) {
294
+ result.ctes = Array.isArray(node.ctes)
295
+ ? node.ctes.map((item: any) => this.transform(item as any, context))
296
+ : this.transform(node.ctes as any, context);
297
+ }
298
+ if (node.recursive !== undefined) {
299
+ result.recursive = node.recursive;
300
+ }
301
+ if (node.location !== undefined) {
302
+ result.location = node.location;
303
+ }
304
+ return { WithClause: result };
305
+ }
306
+ ResTarget(node: any, context: any): {
307
+ ResTarget: any;
308
+ } {
309
+ const result: any = {};
310
+ if (node.name !== undefined) {
311
+ result.name = node.name;
312
+ }
313
+ if (node.indirection !== undefined) {
314
+ result.indirection = Array.isArray(node.indirection)
315
+ ? node.indirection.map((item: any) => this.transform(item as any, context))
316
+ : this.transform(node.indirection as any, context);
317
+ }
318
+ if (node.val !== undefined) {
319
+ result.val = this.transform(node.val as any, context);
320
+ }
321
+ if (node.location !== undefined) {
322
+ result.location = node.location;
323
+ }
324
+ return { ResTarget: result };
325
+ }
326
+ BoolExpr(node: any, context: any): {
327
+ BoolExpr: any;
328
+ } {
329
+ const result: any = {};
330
+ if (node.boolop !== undefined) {
331
+ result.boolop = node.boolop;
332
+ }
333
+ if (node.args !== undefined) {
334
+ result.args = Array.isArray(node.args)
335
+ ? node.args.map((item: any) => this.transform(item as any, context))
336
+ : this.transform(node.args as any, context);
337
+ }
338
+ if (node.location !== undefined) {
339
+ result.location = node.location;
340
+ }
341
+ return { BoolExpr: result };
342
+ }
343
+ FuncCall(node: any, context: any): {
344
+ FuncCall: any;
345
+ } {
346
+ const result: any = {};
347
+ if (node.funcname !== undefined) {
348
+ if (node.funcname.length === 1 && (node.funcname[0] as any)?.String?.sval === 'json_object') {
349
+ result.funcname = [
350
+ {
351
+ String: { sval: 'pg_catalog' }
352
+ },
353
+ { String: { sval: 'json_object' } }
354
+ ];
355
+ }
356
+ else {
357
+ result.funcname = Array.isArray(node.funcname)
358
+ ? node.funcname.map((item: any) => this.transform(item as any, context))
359
+ : this.transform(node.funcname as any, context);
360
+ }
361
+ }
362
+ if (node.args !== undefined) {
363
+ result.args = Array.isArray(node.args)
364
+ ? node.args.map((item: any) => this.transform(item as any, context))
365
+ : this.transform(node.args as any, context);
366
+ }
367
+ if (node.agg_order !== undefined) {
368
+ result.agg_order = Array.isArray(node.agg_order)
369
+ ? node.agg_order.map((item: any) => this.transform(item as any, context))
370
+ : this.transform(node.agg_order as any, context);
371
+ }
372
+ if (node.agg_filter !== undefined) {
373
+ result.agg_filter = this.transform(node.agg_filter as any, context);
374
+ }
375
+ if (node.over !== undefined) {
376
+ result.over = this.transform(node.over as any, context);
377
+ }
378
+ if (node.agg_within_group !== undefined) {
379
+ result.agg_within_group = node.agg_within_group;
380
+ }
381
+ if (node.agg_star !== undefined) {
382
+ result.agg_star = node.agg_star;
383
+ }
384
+ if (node.agg_distinct !== undefined) {
385
+ result.agg_distinct = node.agg_distinct;
386
+ }
387
+ if (node.func_variadic !== undefined) {
388
+ result.func_variadic = node.func_variadic;
389
+ }
390
+ if (node.funcformat !== undefined) {
391
+ result.funcformat = node.funcformat;
392
+ }
393
+ if (node.location !== undefined) {
394
+ result.location = node.location;
395
+ }
396
+ return { FuncCall: result };
397
+ }
398
+ FuncExpr(node: any, context: any): {
399
+ FuncExpr: any;
400
+ } {
401
+ const result: any = {};
402
+ if (node.xpr !== undefined) {
403
+ result.xpr = this.transform(node.xpr as any, context);
404
+ }
405
+ if (node.funcid !== undefined) {
406
+ result.funcid = node.funcid;
407
+ }
408
+ if (node.funcresulttype !== undefined) {
409
+ result.funcresulttype = node.funcresulttype;
410
+ }
411
+ if (node.funcretset !== undefined) {
412
+ result.funcretset = node.funcretset;
413
+ }
414
+ if (node.funcvariadic !== undefined) {
415
+ result.funcvariadic = node.funcvariadic;
416
+ }
417
+ if (node.funcformat !== undefined) {
418
+ result.funcformat = node.funcformat;
419
+ }
420
+ if (node.funccollid !== undefined) {
421
+ result.funccollid = node.funccollid;
422
+ }
423
+ if (node.inputcollid !== undefined) {
424
+ result.inputcollid = node.inputcollid;
425
+ }
426
+ if (node.args !== undefined) {
427
+ result.args = Array.isArray(node.args)
428
+ ? node.args.map((item: any) => this.transform(item as any, context))
429
+ : this.transform(node.args as any, context);
430
+ }
431
+ if (node.location !== undefined) {
432
+ result.location = node.location;
433
+ }
434
+ return { FuncExpr: result };
435
+ }
436
+ A_Const(node: any, context: any): {
437
+ A_Const: any;
438
+ } {
439
+ const result: any = { ...node };
440
+ if (result.val) {
441
+ const val: any = result.val;
442
+ if (val.String && val.String.str !== undefined) {
443
+ result.sval = val.String.str;
444
+ delete result.val;
445
+ }
446
+ else if (val.Integer !== undefined) {
447
+ result.ival = val.Integer;
448
+ delete result.val;
449
+ }
450
+ else if (val.Float && val.Float.str !== undefined) {
451
+ result.fval = val.Float.str;
452
+ delete result.val;
453
+ }
454
+ else if (val.BitString && val.BitString.str !== undefined) {
455
+ result.bsval = val.BitString.str;
456
+ delete result.val;
457
+ }
458
+ else if (val.Null !== undefined) {
459
+ delete result.val;
460
+ }
461
+ }
462
+ return { A_Const: result };
463
+ }
464
+ ColumnRef(node: any, context: any): {
465
+ ColumnRef: any;
466
+ } {
467
+ const result: any = {};
468
+ if (node.fields !== undefined) {
469
+ result.fields = Array.isArray(node.fields)
470
+ ? node.fields.map((item: any) => this.transform(item as any, context))
471
+ : this.transform(node.fields as any, context);
472
+ }
473
+ if (node.location !== undefined) {
474
+ result.location = node.location;
475
+ }
476
+ return { ColumnRef: result };
477
+ }
478
+ TypeName(node: any, context: any): {
479
+ TypeName: any;
480
+ } {
481
+ const result: any = {};
482
+ if (node.names !== undefined) {
483
+ result.names = Array.isArray(node.names)
484
+ ? node.names.map((item: any) => this.transform(item as any, context))
485
+ : this.transform(node.names as any, context);
486
+ }
487
+ if (node.typeOid !== undefined) {
488
+ result.typeOid = node.typeOid;
489
+ }
490
+ if (node.setof !== undefined) {
491
+ result.setof = node.setof;
492
+ }
493
+ if (node.pct_type !== undefined) {
494
+ result.pct_type = node.pct_type;
495
+ }
496
+ if (node.typmods !== undefined) {
497
+ result.typmods = Array.isArray(node.typmods)
498
+ ? node.typmods.map((item: any) => this.transform(item as any, context))
499
+ : this.transform(node.typmods as any, context);
500
+ }
501
+ if (node.typemod !== undefined) {
502
+ result.typemod = node.typemod;
503
+ }
504
+ if (node.arrayBounds !== undefined) {
505
+ const childContext: any = {
506
+ ...context,
507
+ parentNodeTypes: [...(context.parentNodeTypes || []), 'TypeName']
508
+ };
509
+ result.arrayBounds = Array.isArray(node.arrayBounds)
510
+ ? node.arrayBounds.map((item: any) => this.transform(item as any, childContext))
511
+ : this.transform(node.arrayBounds as any, childContext);
512
+ }
513
+ if (node.location !== undefined) {
514
+ result.location = node.location;
515
+ }
516
+ return { TypeName: result };
517
+ }
518
+ Alias(node: any, context: any): {
519
+ Alias: any;
520
+ } {
521
+ const result: any = {};
522
+ if (node.aliasname !== undefined) {
523
+ result.aliasname = node.aliasname;
524
+ }
525
+ if (node.colnames !== undefined) {
526
+ result.colnames = Array.isArray(node.colnames)
527
+ ? node.colnames.map((item: any) => this.transform(item as any, context))
528
+ : this.transform(node.colnames as any, context);
529
+ }
530
+ return { Alias: result };
531
+ }
532
+ RangeVar(node: any, context: any): {
533
+ RangeVar: any;
534
+ } {
535
+ const result: any = {};
536
+ if (node.catalogname !== undefined) {
537
+ result.catalogname = node.catalogname;
538
+ }
539
+ if (node.schemaname !== undefined) {
540
+ result.schemaname = node.schemaname;
541
+ }
542
+ if (node.relname !== undefined) {
543
+ result.relname = node.relname;
544
+ }
545
+ if (node.inh !== undefined) {
546
+ result.inh = node.inh;
547
+ }
548
+ if (node.relpersistence !== undefined) {
549
+ result.relpersistence = node.relpersistence;
550
+ }
551
+ if (node.alias !== undefined) {
552
+ result.alias = this.transform(node.alias as any, context);
553
+ }
554
+ if (node.location !== undefined) {
555
+ result.location = node.location;
556
+ }
557
+ return { RangeVar: result };
558
+ }
559
+ A_ArrayExpr(node: any, context: any): {
560
+ A_ArrayExpr: any;
561
+ } {
562
+ const result: any = {};
563
+ if (node.elements !== undefined) {
564
+ result.elements = Array.isArray(node.elements)
565
+ ? node.elements.map((item: any) => this.transform(item as any, context))
566
+ : this.transform(node.elements as any, context);
567
+ }
568
+ if (node.location !== undefined) {
569
+ result.location = node.location;
570
+ }
571
+ return { A_ArrayExpr: result };
572
+ }
573
+ A_Indices(node: any, context: any): {
574
+ A_Indices: any;
575
+ } {
576
+ const result: any = {};
577
+ if (node.is_slice !== undefined) {
578
+ result.is_slice = node.is_slice;
579
+ }
580
+ if (node.lidx !== undefined) {
581
+ result.lidx = this.transform(node.lidx as any, context);
582
+ }
583
+ if (node.uidx !== undefined) {
584
+ result.uidx = this.transform(node.uidx as any, context);
585
+ }
586
+ return { A_Indices: result };
587
+ }
588
+ A_Indirection(node: any, context: any): {
589
+ A_Indirection: any;
590
+ } {
591
+ const result: any = {};
592
+ if (node.arg !== undefined) {
593
+ result.arg = this.transform(node.arg as any, context);
594
+ }
595
+ if (node.indirection !== undefined) {
596
+ result.indirection = Array.isArray(node.indirection)
597
+ ? node.indirection.map((item: any) => this.transform(item as any, context))
598
+ : this.transform(node.indirection as any, context);
599
+ }
600
+ return { A_Indirection: result };
601
+ }
602
+ A_Star(node: any, context: any): {
603
+ A_Star: any;
604
+ } {
605
+ const result: any = {};
606
+ return { A_Star: result };
607
+ }
608
+ CaseExpr(node: any, context: any): {
609
+ CaseExpr: any;
610
+ } {
611
+ const result: any = {};
612
+ if (node.xpr !== undefined) {
613
+ result.xpr = this.transform(node.xpr as any, context);
614
+ }
615
+ if (node.casetype !== undefined) {
616
+ result.casetype = node.casetype;
617
+ }
618
+ if (node.casecollid !== undefined) {
619
+ result.casecollid = node.casecollid;
620
+ }
621
+ if (node.arg !== undefined) {
622
+ result.arg = this.transform(node.arg as any, context);
623
+ }
624
+ if (node.args !== undefined) {
625
+ result.args = Array.isArray(node.args)
626
+ ? node.args.map((item: any) => this.transform(item as any, context))
627
+ : this.transform(node.args as any, context);
628
+ }
629
+ if (node.defresult !== undefined) {
630
+ result.defresult = this.transform(node.defresult as any, context);
631
+ }
632
+ if (node.location !== undefined) {
633
+ result.location = node.location;
634
+ }
635
+ return { CaseExpr: result };
636
+ }
637
+ CoalesceExpr(node: any, context: any): {
638
+ CoalesceExpr: any;
639
+ } {
640
+ const result: any = {};
641
+ if (node.xpr !== undefined) {
642
+ result.xpr = this.transform(node.xpr as any, context);
643
+ }
644
+ if (node.coalescetype !== undefined) {
645
+ result.coalescetype = node.coalescetype;
646
+ }
647
+ if (node.coalescecollid !== undefined) {
648
+ result.coalescecollid = node.coalescecollid;
649
+ }
650
+ if (node.args !== undefined) {
651
+ result.args = Array.isArray(node.args)
652
+ ? node.args.map((item: any) => this.transform(item as any, context))
653
+ : this.transform(node.args as any, context);
654
+ }
655
+ if (node.location !== undefined) {
656
+ result.location = node.location;
657
+ }
658
+ return { CoalesceExpr: result };
659
+ }
660
+ TypeCast(node: any, context: any): {
661
+ TypeCast: any;
662
+ } {
663
+ const result: any = {};
664
+ if (node.arg !== undefined) {
665
+ result.arg = this.transform(node.arg as any, context);
666
+ }
667
+ if (node.typeName !== undefined) {
668
+ const childContext: any = {
669
+ ...context,
670
+ parentNodeTypes: [...(context.parentNodeTypes || []), 'TypeCast']
671
+ };
672
+ result.typeName = this.TypeName(node.typeName as any, childContext).TypeName;
673
+ }
674
+ if (node.location !== undefined) {
675
+ result.location = node.location;
676
+ }
677
+ return { TypeCast: result };
678
+ }
679
+ CollateClause(node: any, context: any): {
680
+ CollateClause: any;
681
+ } {
682
+ const result: any = {};
683
+ if (node.arg !== undefined) {
684
+ result.arg = this.transform(node.arg as any, context);
685
+ }
686
+ if (node.collname !== undefined) {
687
+ result.collname = Array.isArray(node.collname)
688
+ ? node.collname.map((item: any) => this.transform(item as any, context))
689
+ : this.transform(node.collname as any, context);
690
+ }
691
+ if (node.location !== undefined) {
692
+ result.location = node.location;
693
+ }
694
+ return { CollateClause: result };
695
+ }
696
+ BooleanTest(node: any, context: any): {
697
+ BooleanTest: any;
698
+ } {
699
+ const result: any = {};
700
+ if (node.xpr !== undefined) {
701
+ result.xpr = this.transform(node.xpr as any, context);
702
+ }
703
+ if (node.arg !== undefined) {
704
+ result.arg = this.transform(node.arg as any, context);
705
+ }
706
+ if (node.booltesttype !== undefined) {
707
+ result.booltesttype = node.booltesttype;
708
+ }
709
+ if (node.location !== undefined) {
710
+ result.location = node.location;
711
+ }
712
+ return { BooleanTest: result };
713
+ }
714
+ NullTest(node: any, context: any): {
715
+ NullTest: any;
716
+ } {
717
+ const result: any = {};
718
+ if (node.xpr !== undefined) {
719
+ result.xpr = this.transform(node.xpr as any, context);
720
+ }
721
+ if (node.arg !== undefined) {
722
+ result.arg = this.transform(node.arg as any, context);
723
+ }
724
+ if (node.nulltesttype !== undefined) {
725
+ result.nulltesttype = node.nulltesttype;
726
+ }
727
+ if (node.argisrow !== undefined) {
728
+ result.argisrow = node.argisrow;
729
+ }
730
+ if (node.location !== undefined) {
731
+ result.location = node.location;
732
+ }
733
+ return { NullTest: result };
734
+ }
735
+ String(node: any, context: any): {
736
+ String: any;
737
+ } {
738
+ const result: any = { ...node };
739
+ return { String: result };
740
+ }
741
+ Integer(node: any, context: any): {
742
+ Integer: any;
743
+ } {
744
+ const result: any = { ...node };
745
+ return { Integer: result };
746
+ }
747
+ Float(node: any, context: any): {
748
+ Float: any;
749
+ } {
750
+ const result: any = { ...node };
751
+ return { Float: result };
752
+ }
753
+ Boolean(node: any, context: any): {
754
+ Boolean: any;
755
+ } {
756
+ const result: any = { ...node };
757
+ return { Boolean: result };
758
+ }
759
+ BitString(node: any, context: any): {
760
+ BitString: any;
761
+ } {
762
+ const result: any = { ...node };
763
+ return { BitString: result };
764
+ }
765
+ Null(node: any, context: any): {
766
+ Null: {};
767
+ } {
768
+ return { Null: {} };
769
+ }
770
+ List(node: any, context: any): {
771
+ List: any;
772
+ } {
773
+ const result: any = {};
774
+ if (node.items !== undefined) {
775
+ result.items = Array.isArray(node.items)
776
+ ? node.items.map((item: any) => this.transform(item as any, context))
777
+ : this.transform(node.items as any, context);
778
+ }
779
+ return { List: result };
780
+ }
781
+ CreateStmt(node: any, context: any): {
782
+ CreateStmt: any;
783
+ } {
784
+ const result: any = {};
785
+ if (node.relation !== undefined) {
786
+ result.relation = this.transform(node.relation as any, context);
787
+ }
788
+ if (node.tableElts !== undefined) {
789
+ result.tableElts = Array.isArray(node.tableElts)
790
+ ? node.tableElts.map((item: any) => this.transform(item as any, context))
791
+ : this.transform(node.tableElts as any, context);
792
+ }
793
+ if (node.inhRelations !== undefined) {
794
+ result.inhRelations = Array.isArray(node.inhRelations)
795
+ ? node.inhRelations.map((item: any) => this.transform(item as any, context))
796
+ : this.transform(node.inhRelations as any, context);
797
+ }
798
+ if (node.partbound !== undefined) {
799
+ result.partbound = this.transform(node.partbound as any, context);
800
+ }
801
+ if (node.partspec !== undefined) {
802
+ // Handle partspec transformation directly since it's a plain object, not a wrapped node
803
+ const partspec: any = { ...node.partspec };
804
+ if (partspec.strategy !== undefined) {
805
+ const strategyMap: Record<string, string> = {
806
+ 'range': 'PARTITION_STRATEGY_RANGE',
807
+ 'list': 'PARTITION_STRATEGY_LIST',
808
+ 'hash': 'PARTITION_STRATEGY_HASH'
809
+ };
810
+ partspec.strategy = strategyMap[partspec.strategy] || partspec.strategy;
811
+ }
812
+ if (partspec.partParams !== undefined) {
813
+ partspec.partParams = Array.isArray(partspec.partParams)
814
+ ? partspec.partParams.map((item: any) => this.transform(item as any, context))
815
+ : this.transform(partspec.partParams as any, context);
816
+ }
817
+ result.partspec = partspec;
818
+ }
819
+ if (node.ofTypename !== undefined) {
820
+ result.ofTypename = this.transform(node.ofTypename as any, context);
821
+ }
822
+ if (node.constraints !== undefined) {
823
+ result.constraints = Array.isArray(node.constraints)
824
+ ? node.constraints.map((item: any) => this.transform(item as any, context))
825
+ : this.transform(node.constraints as any, context);
826
+ }
827
+ if (node.options !== undefined) {
828
+ result.options = Array.isArray(node.options)
829
+ ? node.options.map((item: any) => this.transform(item as any, context))
830
+ : this.transform(node.options as any, context);
831
+ }
832
+ if (node.oncommit !== undefined) {
833
+ result.oncommit = node.oncommit;
834
+ }
835
+ if (node.tablespacename !== undefined) {
836
+ result.tablespacename = node.tablespacename;
837
+ }
838
+ if (node.accessMethod !== undefined) {
839
+ result.accessMethod = node.accessMethod;
840
+ }
841
+ if (node.if_not_exists !== undefined) {
842
+ result.if_not_exists = node.if_not_exists;
843
+ }
844
+ return { CreateStmt: result };
845
+ }
846
+ ColumnDef(node: any, context: any): {
847
+ ColumnDef: any;
848
+ } {
849
+ const result: any = {};
850
+ if (node.colname !== undefined) {
851
+ result.colname = node.colname;
852
+ }
853
+ if (node.typeName !== undefined) {
854
+ const transformedTypeName = this.transform({ TypeName: node.typeName } as any, context);
855
+ result.typeName = transformedTypeName.TypeName;
856
+ }
857
+ if (node.inhcount !== undefined) {
858
+ result.inhcount = node.inhcount;
859
+ }
860
+ if (node.is_local !== undefined) {
861
+ result.is_local = node.is_local;
862
+ }
863
+ if (node.is_not_null !== undefined) {
864
+ result.is_not_null = node.is_not_null;
865
+ }
866
+ if (node.is_from_type !== undefined) {
867
+ result.is_from_type = node.is_from_type;
868
+ }
869
+ if (node.storage !== undefined) {
870
+ result.storage = node.storage;
871
+ }
872
+ if (node.raw_default !== undefined) {
873
+ result.raw_default = this.transform(node.raw_default as any, context);
874
+ }
875
+ if (node.cooked_default !== undefined) {
876
+ result.cooked_default = this.transform(node.cooked_default as any, context);
877
+ }
878
+ if (node.identity !== undefined) {
879
+ result.identity = node.identity;
880
+ }
881
+ if (node.identitySequence !== undefined) {
882
+ result.identitySequence = this.transform(node.identitySequence as any, context);
883
+ }
884
+ if (node.generated !== undefined) {
885
+ result.generated = node.generated;
886
+ }
887
+ if (node.collClause !== undefined) {
888
+ result.collClause = this.transform(node.collClause as any, context);
889
+ }
890
+ if (node.collOid !== undefined) {
891
+ result.collOid = node.collOid;
892
+ }
893
+ if (node.constraints !== undefined) {
894
+ result.constraints = Array.isArray(node.constraints)
895
+ ? node.constraints.map((item: any) => this.transform(item as any, context))
896
+ : this.transform(node.constraints as any, context);
897
+ }
898
+ if (node.fdwoptions !== undefined) {
899
+ result.fdwoptions = Array.isArray(node.fdwoptions)
900
+ ? node.fdwoptions.map((item: any) => this.transform(item as any, context))
901
+ : this.transform(node.fdwoptions as any, context);
902
+ }
903
+ if (node.location !== undefined) {
904
+ result.location = node.location;
905
+ }
906
+ return { ColumnDef: result };
907
+ }
908
+ Constraint(node: any, context: any): {
909
+ Constraint: any;
910
+ } {
911
+ const result: any = {};
912
+ if (node.contype !== undefined) {
913
+ result.contype = node.contype;
914
+ }
915
+ if (node.conname !== undefined) {
916
+ result.conname = node.conname;
917
+ }
918
+ if (node.deferrable !== undefined) {
919
+ result.deferrable = node.deferrable;
920
+ }
921
+ if (node.initdeferred !== undefined) {
922
+ result.initdeferred = node.initdeferred;
923
+ }
924
+ if (node.location !== undefined) {
925
+ result.location = node.location;
926
+ }
927
+ if (node.is_no_inherit !== undefined) {
928
+ result.is_no_inherit = node.is_no_inherit;
929
+ }
930
+ if (node.raw_expr !== undefined) {
931
+ result.raw_expr = this.transform(node.raw_expr as any, context);
932
+ }
933
+ if (node.cooked_expr !== undefined) {
934
+ result.cooked_expr = node.cooked_expr;
935
+ }
936
+ if (node.generated_when !== undefined) {
937
+ result.generated_when = node.generated_when;
938
+ }
939
+ if (node.keys !== undefined) {
940
+ result.keys = Array.isArray(node.keys)
941
+ ? node.keys.map((item: any) => this.transform(item as any, context))
942
+ : this.transform(node.keys as any, context);
943
+ }
944
+ if (node.including !== undefined) {
945
+ result.including = Array.isArray(node.including)
946
+ ? node.including.map((item: any) => this.transform(item as any, context))
947
+ : this.transform(node.including as any, context);
948
+ }
949
+ if (node.exclusions !== undefined) {
950
+ result.exclusions = Array.isArray(node.exclusions)
951
+ ? node.exclusions.map((item: any) => this.transform(item as any, context))
952
+ : this.transform(node.exclusions as any, context);
953
+ }
954
+ if (node.options !== undefined) {
955
+ result.options = Array.isArray(node.options)
956
+ ? node.options.map((item: any) => this.transform(item as any, context))
957
+ : this.transform(node.options as any, context);
958
+ }
959
+ if (node.indexname !== undefined) {
960
+ result.indexname = node.indexname;
961
+ }
962
+ if (node.indexspace !== undefined) {
963
+ result.indexspace = node.indexspace;
964
+ }
965
+ if (node.reset_default_tblspc !== undefined) {
966
+ result.reset_default_tblspc = node.reset_default_tblspc;
967
+ }
968
+ if (node.access_method !== undefined) {
969
+ result.access_method = node.access_method;
970
+ }
971
+ if (node.where_clause !== undefined) {
972
+ result.where_clause = this.transform(node.where_clause as any, context);
973
+ }
974
+ if (node.pktable !== undefined) {
975
+ result.pktable = this.transform(node.pktable as any, context);
976
+ }
977
+ if (node.fk_attrs !== undefined) {
978
+ result.fk_attrs = Array.isArray(node.fk_attrs)
979
+ ? node.fk_attrs.map((item: any) => this.transform(item as any, context))
980
+ : this.transform(node.fk_attrs as any, context);
981
+ }
982
+ if (node.pk_attrs !== undefined) {
983
+ result.pk_attrs = Array.isArray(node.pk_attrs)
984
+ ? node.pk_attrs.map((item: any) => this.transform(item as any, context))
985
+ : this.transform(node.pk_attrs as any, context);
986
+ }
987
+ if (node.fk_matchtype !== undefined) {
988
+ result.fk_matchtype = node.fk_matchtype;
989
+ }
990
+ if (node.fk_upd_action !== undefined) {
991
+ result.fk_upd_action = node.fk_upd_action;
992
+ }
993
+ if (node.fk_del_action !== undefined) {
994
+ result.fk_del_action = node.fk_del_action;
995
+ }
996
+ if (node.old_conpfeqop !== undefined) {
997
+ result.old_conpfeqop = Array.isArray(node.old_conpfeqop)
998
+ ? node.old_conpfeqop.map((item: any) => this.transform(item as any, context))
999
+ : this.transform(node.old_conpfeqop as any, context);
1000
+ }
1001
+ if (node.old_pktable_oid !== undefined) {
1002
+ result.old_pktable_oid = node.old_pktable_oid;
1003
+ }
1004
+ if (node.skip_validation !== undefined) {
1005
+ result.skip_validation = node.skip_validation;
1006
+ }
1007
+ if (node.initially_valid !== undefined) {
1008
+ result.initially_valid = node.initially_valid;
1009
+ }
1010
+ if (node.nulls_not_distinct !== undefined) {
1011
+ result.nulls_not_distinct = node.nulls_not_distinct;
1012
+ }
1013
+ return { Constraint: result };
1014
+ }
1015
+ SubLink(node: any, context: any): {
1016
+ SubLink: any;
1017
+ } {
1018
+ const result: any = {};
1019
+ if (node.xpr !== undefined) {
1020
+ result.xpr = this.transform(node.xpr as any, context);
1021
+ }
1022
+ if (node.subLinkType !== undefined) {
1023
+ result.subLinkType = node.subLinkType;
1024
+ }
1025
+ if (node.subLinkId !== undefined) {
1026
+ result.subLinkId = node.subLinkId;
1027
+ }
1028
+ if (node.testexpr !== undefined) {
1029
+ result.testexpr = this.transform(node.testexpr as any, context);
1030
+ }
1031
+ if (node.operName !== undefined) {
1032
+ result.operName = Array.isArray(node.operName)
1033
+ ? node.operName.map((item: any) => this.transform(item as any, context))
1034
+ : this.transform(node.operName as any, context);
1035
+ }
1036
+ if (node.subselect !== undefined) {
1037
+ result.subselect = this.transform(node.subselect as any, context);
1038
+ }
1039
+ if (node.location !== undefined) {
1040
+ result.location = node.location;
1041
+ }
1042
+ return { SubLink: result };
1043
+ }
1044
+ CaseWhen(node: any, context: any): {
1045
+ CaseWhen: any;
1046
+ } {
1047
+ const result: any = {};
1048
+ if (node.xpr !== undefined) {
1049
+ result.xpr = this.transform(node.xpr as any, context);
1050
+ }
1051
+ if (node.expr !== undefined) {
1052
+ result.expr = this.transform(node.expr as any, context);
1053
+ }
1054
+ if (node.result !== undefined) {
1055
+ result.result = this.transform(node.result as any, context);
1056
+ }
1057
+ if (node.location !== undefined) {
1058
+ result.location = node.location;
1059
+ }
1060
+ return { CaseWhen: result };
1061
+ }
1062
+ WindowDef(node: any, context: any): {
1063
+ WindowDef: any;
1064
+ } {
1065
+ const result: any = {};
1066
+ if (node.name !== undefined) {
1067
+ result.name = node.name;
1068
+ }
1069
+ if (node.refname !== undefined) {
1070
+ result.refname = node.refname;
1071
+ }
1072
+ if (node.partitionClause !== undefined) {
1073
+ result.partitionClause = Array.isArray(node.partitionClause)
1074
+ ? node.partitionClause.map((item: any) => this.transform(item as any, context))
1075
+ : this.transform(node.partitionClause as any, context);
1076
+ }
1077
+ if (node.orderClause !== undefined) {
1078
+ result.orderClause = Array.isArray(node.orderClause)
1079
+ ? node.orderClause.map((item: any) => this.transform(item as any, context))
1080
+ : this.transform(node.orderClause as any, context);
1081
+ }
1082
+ if (node.frameOptions !== undefined) {
1083
+ result.frameOptions = node.frameOptions;
1084
+ }
1085
+ if (node.startOffset !== undefined) {
1086
+ result.startOffset = this.transform(node.startOffset as any, context);
1087
+ }
1088
+ if (node.endOffset !== undefined) {
1089
+ result.endOffset = this.transform(node.endOffset as any, context);
1090
+ }
1091
+ if (node.location !== undefined) {
1092
+ result.location = node.location;
1093
+ }
1094
+ return { WindowDef: result };
1095
+ }
1096
+ SortBy(node: any, context: any): {
1097
+ SortBy: any;
1098
+ } {
1099
+ const result: any = {};
1100
+ if (node.node !== undefined) {
1101
+ result.node = this.transform(node.node as any, context);
1102
+ }
1103
+ if (node.sortby_dir !== undefined) {
1104
+ result.sortby_dir = node.sortby_dir;
1105
+ }
1106
+ if (node.sortby_nulls !== undefined) {
1107
+ result.sortby_nulls = node.sortby_nulls;
1108
+ }
1109
+ if (node.useOp !== undefined) {
1110
+ result.useOp = Array.isArray(node.useOp)
1111
+ ? node.useOp.map((item: any) => this.transform(item as any, context))
1112
+ : this.transform(node.useOp as any, context);
1113
+ }
1114
+ if (node.location !== undefined) {
1115
+ result.location = node.location;
1116
+ }
1117
+ return { SortBy: result };
1118
+ }
1119
+ GroupingSet(node: any, context: any): {
1120
+ GroupingSet: any;
1121
+ } {
1122
+ const result: any = {};
1123
+ if (node.kind !== undefined) {
1124
+ result.kind = node.kind;
1125
+ }
1126
+ if (node.content !== undefined) {
1127
+ result.content = Array.isArray(node.content)
1128
+ ? node.content.map((item: any) => this.transform(item as any, context))
1129
+ : this.transform(node.content as any, context);
1130
+ }
1131
+ if (node.location !== undefined) {
1132
+ result.location = node.location;
1133
+ }
1134
+ return { GroupingSet: result };
1135
+ }
1136
+ CommonTableExpr(node: any, context: any): {
1137
+ CommonTableExpr: any;
1138
+ } {
1139
+ const result: any = {};
1140
+ if (node.ctename !== undefined) {
1141
+ result.ctename = node.ctename;
1142
+ }
1143
+ if (node.aliascolnames !== undefined) {
1144
+ result.aliascolnames = Array.isArray(node.aliascolnames)
1145
+ ? node.aliascolnames.map((item: any) => this.transform(item as any, context))
1146
+ : this.transform(node.aliascolnames as any, context);
1147
+ }
1148
+ if (node.ctematerialized !== undefined) {
1149
+ result.ctematerialized = node.ctematerialized;
1150
+ }
1151
+ if (node.ctequery !== undefined) {
1152
+ result.ctequery = this.transform(node.ctequery as any, context);
1153
+ }
1154
+ if (node.location !== undefined) {
1155
+ result.location = node.location;
1156
+ }
1157
+ if (node.cterecursive !== undefined) {
1158
+ result.cterecursive = node.cterecursive;
1159
+ }
1160
+ if (node.cterefcount !== undefined) {
1161
+ result.cterefcount = node.cterefcount;
1162
+ }
1163
+ if (node.ctecolnames !== undefined) {
1164
+ result.ctecolnames = Array.isArray(node.ctecolnames)
1165
+ ? node.ctecolnames.map((item: any) => this.transform(item as any, context))
1166
+ : this.transform(node.ctecolnames as any, context);
1167
+ }
1168
+ if (node.ctecoltypes !== undefined) {
1169
+ result.ctecoltypes = Array.isArray(node.ctecoltypes)
1170
+ ? node.ctecoltypes.map((item: any) => this.transform(item as any, context))
1171
+ : this.transform(node.ctecoltypes as any, context);
1172
+ }
1173
+ if (node.ctecoltypmods !== undefined) {
1174
+ result.ctecoltypmods = Array.isArray(node.ctecoltypmods)
1175
+ ? node.ctecoltypmods.map((item: any) => this.transform(item as any, context))
1176
+ : this.transform(node.ctecoltypmods as any, context);
1177
+ }
1178
+ if (node.ctecolcollations !== undefined) {
1179
+ result.ctecolcollations = Array.isArray(node.ctecolcollations)
1180
+ ? node.ctecolcollations.map((item: any) => this.transform(item as any, context))
1181
+ : this.transform(node.ctecolcollations as any, context);
1182
+ }
1183
+ return { CommonTableExpr: result };
1184
+ }
1185
+ ParamRef(node: any, context: any): {
1186
+ ParamRef: any;
1187
+ } {
1188
+ const result: any = {};
1189
+ if (node.number !== undefined) {
1190
+ result.number = node.number;
1191
+ }
1192
+ if (node.location !== undefined) {
1193
+ result.location = node.location;
1194
+ }
1195
+ return { ParamRef: result };
1196
+ }
1197
+ LockingClause(node: any, context: any): {
1198
+ LockingClause: any;
1199
+ } {
1200
+ const result: any = {};
1201
+ if (node.lockedRels !== undefined) {
1202
+ result.lockedRels = Array.isArray(node.lockedRels)
1203
+ ? node.lockedRels.map((item: any) => this.transform(item as any, context))
1204
+ : this.transform(node.lockedRels as any, context);
1205
+ }
1206
+ if (node.strength !== undefined) {
1207
+ result.strength = node.strength;
1208
+ }
1209
+ if (node.waitPolicy !== undefined) {
1210
+ result.waitPolicy = node.waitPolicy;
1211
+ }
1212
+ return { LockingClause: result };
1213
+ }
1214
+ MinMaxExpr(node: any, context: any): {
1215
+ MinMaxExpr: any;
1216
+ } {
1217
+ const result: any = {};
1218
+ if (node.xpr !== undefined) {
1219
+ result.xpr = this.transform(node.xpr as any, context);
1220
+ }
1221
+ if (node.minmaxtype !== undefined) {
1222
+ result.minmaxtype = node.minmaxtype;
1223
+ }
1224
+ if (node.minmaxcollid !== undefined) {
1225
+ result.minmaxcollid = node.minmaxcollid;
1226
+ }
1227
+ if (node.inputcollid !== undefined) {
1228
+ result.inputcollid = node.inputcollid;
1229
+ }
1230
+ if (node.op !== undefined) {
1231
+ result.op = node.op;
1232
+ }
1233
+ if (node.args !== undefined) {
1234
+ result.args = Array.isArray(node.args)
1235
+ ? node.args.map((item: any) => this.transform(item as any, context))
1236
+ : this.transform(node.args as any, context);
1237
+ }
1238
+ if (node.location !== undefined) {
1239
+ result.location = node.location;
1240
+ }
1241
+ return { MinMaxExpr: result };
1242
+ }
1243
+ RowExpr(node: any, context: any): {
1244
+ RowExpr: any;
1245
+ } {
1246
+ const result: any = {};
1247
+ if (node.xpr !== undefined) {
1248
+ result.xpr = this.transform(node.xpr as any, context);
1249
+ }
1250
+ if (node.args !== undefined) {
1251
+ result.args = Array.isArray(node.args)
1252
+ ? node.args.map((item: any) => this.transform(item as any, context))
1253
+ : this.transform(node.args as any, context);
1254
+ }
1255
+ if (node.row_typeid !== undefined) {
1256
+ result.row_typeid = node.row_typeid;
1257
+ }
1258
+ if (node.row_format !== undefined) {
1259
+ result.row_format = node.row_format;
1260
+ }
1261
+ if (node.colnames !== undefined) {
1262
+ result.colnames = Array.isArray(node.colnames)
1263
+ ? node.colnames.map((item: any) => this.transform(item as any, context))
1264
+ : this.transform(node.colnames as any, context);
1265
+ }
1266
+ if (node.location !== undefined) {
1267
+ result.location = node.location;
1268
+ }
1269
+ return { RowExpr: result };
1270
+ }
1271
+ OpExpr(node: any, context: any): {
1272
+ OpExpr: any;
1273
+ } {
1274
+ const result: any = {};
1275
+ if (node.xpr !== undefined) {
1276
+ result.xpr = this.transform(node.xpr as any, context);
1277
+ }
1278
+ if (node.opno !== undefined) {
1279
+ result.opno = node.opno;
1280
+ }
1281
+ if (node.opfuncid !== undefined) {
1282
+ result.opfuncid = node.opfuncid;
1283
+ }
1284
+ if (node.opresulttype !== undefined) {
1285
+ result.opresulttype = node.opresulttype;
1286
+ }
1287
+ if (node.opretset !== undefined) {
1288
+ result.opretset = node.opretset;
1289
+ }
1290
+ if (node.opcollid !== undefined) {
1291
+ result.opcollid = node.opcollid;
1292
+ }
1293
+ if (node.inputcollid !== undefined) {
1294
+ result.inputcollid = node.inputcollid;
1295
+ }
1296
+ if (node.args !== undefined) {
1297
+ result.args = Array.isArray(node.args)
1298
+ ? node.args.map((item: any) => this.transform(item as any, context))
1299
+ : this.transform(node.args as any, context);
1300
+ }
1301
+ if (node.location !== undefined) {
1302
+ result.location = node.location;
1303
+ }
1304
+ return { OpExpr: result };
1305
+ }
1306
+ DistinctExpr(node: any, context: any): {
1307
+ DistinctExpr: any;
1308
+ } {
1309
+ const result: any = {};
1310
+ if (node.xpr !== undefined) {
1311
+ result.xpr = this.transform(node.xpr as any, context);
1312
+ }
1313
+ if (node.opno !== undefined) {
1314
+ result.opno = node.opno;
1315
+ }
1316
+ if (node.opfuncid !== undefined) {
1317
+ result.opfuncid = node.opfuncid;
1318
+ }
1319
+ if (node.opresulttype !== undefined) {
1320
+ result.opresulttype = node.opresulttype;
1321
+ }
1322
+ if (node.opretset !== undefined) {
1323
+ result.opretset = node.opretset;
1324
+ }
1325
+ if (node.opcollid !== undefined) {
1326
+ result.opcollid = node.opcollid;
1327
+ }
1328
+ if (node.inputcollid !== undefined) {
1329
+ result.inputcollid = node.inputcollid;
1330
+ }
1331
+ if (node.args !== undefined) {
1332
+ result.args = Array.isArray(node.args)
1333
+ ? node.args.map((item: any) => this.transform(item as any, context))
1334
+ : this.transform(node.args as any, context);
1335
+ }
1336
+ if (node.location !== undefined) {
1337
+ result.location = node.location;
1338
+ }
1339
+ return { DistinctExpr: result };
1340
+ }
1341
+ NullIfExpr(node: any, context: any): {
1342
+ NullIfExpr: any;
1343
+ } {
1344
+ const result: any = {};
1345
+ if (node.xpr !== undefined) {
1346
+ result.xpr = this.transform(node.xpr as any, context);
1347
+ }
1348
+ if (node.opno !== undefined) {
1349
+ result.opno = node.opno;
1350
+ }
1351
+ if (node.opfuncid !== undefined) {
1352
+ result.opfuncid = node.opfuncid;
1353
+ }
1354
+ if (node.opresulttype !== undefined) {
1355
+ result.opresulttype = node.opresulttype;
1356
+ }
1357
+ if (node.opretset !== undefined) {
1358
+ result.opretset = node.opretset;
1359
+ }
1360
+ if (node.opcollid !== undefined) {
1361
+ result.opcollid = node.opcollid;
1362
+ }
1363
+ if (node.inputcollid !== undefined) {
1364
+ result.inputcollid = node.inputcollid;
1365
+ }
1366
+ if (node.args !== undefined) {
1367
+ result.args = Array.isArray(node.args)
1368
+ ? node.args.map((item: any) => this.transform(item as any, context))
1369
+ : this.transform(node.args as any, context);
1370
+ }
1371
+ if (node.location !== undefined) {
1372
+ result.location = node.location;
1373
+ }
1374
+ return { NullIfExpr: result };
1375
+ }
1376
+ ScalarArrayOpExpr(node: any, context: any): {
1377
+ ScalarArrayOpExpr: any;
1378
+ } {
1379
+ const result: any = {};
1380
+ if (node.xpr !== undefined) {
1381
+ result.xpr = this.transform(node.xpr as any, context);
1382
+ }
1383
+ if (node.opno !== undefined) {
1384
+ result.opno = node.opno;
1385
+ }
1386
+ if (node.opfuncid !== undefined) {
1387
+ result.opfuncid = node.opfuncid;
1388
+ }
1389
+ if (node.hashfuncid !== undefined) {
1390
+ result.hashfuncid = node.hashfuncid;
1391
+ }
1392
+ if (node.useOr !== undefined) {
1393
+ result.useOr = node.useOr;
1394
+ }
1395
+ if (node.inputcollid !== undefined) {
1396
+ result.inputcollid = node.inputcollid;
1397
+ }
1398
+ if (node.args !== undefined) {
1399
+ result.args = Array.isArray(node.args)
1400
+ ? node.args.map((item: any) => this.transform(item as any, context))
1401
+ : this.transform(node.args as any, context);
1402
+ }
1403
+ if (node.location !== undefined) {
1404
+ result.location = node.location;
1405
+ }
1406
+ return { ScalarArrayOpExpr: result };
1407
+ }
1408
+ Aggref(node: any, context: any): {
1409
+ Aggref: any;
1410
+ } {
1411
+ const result: any = {};
1412
+ if (node.xpr !== undefined) {
1413
+ result.xpr = this.transform(node.xpr as any, context);
1414
+ }
1415
+ if (node.aggfnoid !== undefined) {
1416
+ result.aggfnoid = node.aggfnoid;
1417
+ }
1418
+ if (node.aggtype !== undefined) {
1419
+ result.aggtype = node.aggtype;
1420
+ }
1421
+ if (node.aggcollid !== undefined) {
1422
+ result.aggcollid = node.aggcollid;
1423
+ }
1424
+ if (node.inputcollid !== undefined) {
1425
+ result.inputcollid = node.inputcollid;
1426
+ }
1427
+ if (node.aggtranstype !== undefined) {
1428
+ result.aggtranstype = node.aggtranstype;
1429
+ }
1430
+ if (node.aggargtypes !== undefined) {
1431
+ result.aggargtypes = Array.isArray(node.aggargtypes)
1432
+ ? node.aggargtypes.map((item: any) => this.transform(item as any, context))
1433
+ : this.transform(node.aggargtypes as any, context);
1434
+ }
1435
+ if (node.aggdirectargs !== undefined) {
1436
+ result.aggdirectargs = Array.isArray(node.aggdirectargs)
1437
+ ? node.aggdirectargs.map((item: any) => this.transform(item as any, context))
1438
+ : this.transform(node.aggdirectargs as any, context);
1439
+ }
1440
+ if (node.args !== undefined) {
1441
+ result.args = Array.isArray(node.args)
1442
+ ? node.args.map((item: any) => this.transform(item as any, context))
1443
+ : this.transform(node.args as any, context);
1444
+ }
1445
+ if (node.aggorder !== undefined) {
1446
+ result.aggorder = Array.isArray(node.aggorder)
1447
+ ? node.aggorder.map((item: any) => this.transform(item as any, context))
1448
+ : this.transform(node.aggorder as any, context);
1449
+ }
1450
+ if (node.aggdistinct !== undefined) {
1451
+ result.aggdistinct = Array.isArray(node.aggdistinct)
1452
+ ? node.aggdistinct.map((item: any) => this.transform(item as any, context))
1453
+ : this.transform(node.aggdistinct as any, context);
1454
+ }
1455
+ if (node.aggfilter !== undefined) {
1456
+ result.aggfilter = this.transform(node.aggfilter as any, context);
1457
+ }
1458
+ if (node.aggstar !== undefined) {
1459
+ result.aggstar = node.aggstar;
1460
+ }
1461
+ if (node.aggvariadic !== undefined) {
1462
+ result.aggvariadic = node.aggvariadic;
1463
+ }
1464
+ if (node.aggkind !== undefined) {
1465
+ result.aggkind = node.aggkind;
1466
+ }
1467
+ if (node.agglevelsup !== undefined) {
1468
+ result.agglevelsup = node.agglevelsup;
1469
+ }
1470
+ if (node.aggsplit !== undefined) {
1471
+ result.aggsplit = node.aggsplit;
1472
+ }
1473
+ if (node.aggno !== undefined) {
1474
+ result.aggno = node.aggno;
1475
+ }
1476
+ if (node.aggtransno !== undefined) {
1477
+ result.aggtransno = node.aggtransno;
1478
+ }
1479
+ if (node.location !== undefined) {
1480
+ result.location = node.location;
1481
+ }
1482
+ return { Aggref: result };
1483
+ }
1484
+ WindowFunc(node: any, context: any): {
1485
+ WindowFunc: any;
1486
+ } {
1487
+ const result: any = {};
1488
+ if (node.xpr !== undefined) {
1489
+ result.xpr = this.transform(node.xpr as any, context);
1490
+ }
1491
+ if (node.winfnoid !== undefined) {
1492
+ result.winfnoid = node.winfnoid;
1493
+ }
1494
+ if (node.wintype !== undefined) {
1495
+ result.wintype = node.wintype;
1496
+ }
1497
+ if (node.wincollid !== undefined) {
1498
+ result.wincollid = node.wincollid;
1499
+ }
1500
+ if (node.inputcollid !== undefined) {
1501
+ result.inputcollid = node.inputcollid;
1502
+ }
1503
+ if (node.args !== undefined) {
1504
+ result.args = Array.isArray(node.args)
1505
+ ? node.args.map((item: any) => this.transform(item as any, context))
1506
+ : this.transform(node.args as any, context);
1507
+ }
1508
+ if (node.aggfilter !== undefined) {
1509
+ result.aggfilter = this.transform(node.aggfilter as any, context);
1510
+ }
1511
+ if (node.winref !== undefined) {
1512
+ result.winref = node.winref;
1513
+ }
1514
+ if (node.winstar !== undefined) {
1515
+ result.winstar = node.winstar;
1516
+ }
1517
+ if (node.winagg !== undefined) {
1518
+ result.winagg = node.winagg;
1519
+ }
1520
+ if (node.location !== undefined) {
1521
+ result.location = node.location;
1522
+ }
1523
+ return { WindowFunc: result };
1524
+ }
1525
+ FieldSelect(node: any, context: any): {
1526
+ FieldSelect: any;
1527
+ } {
1528
+ const result: any = {};
1529
+ if (node.xpr !== undefined) {
1530
+ result.xpr = this.transform(node.xpr as any, context);
1531
+ }
1532
+ if (node.arg !== undefined) {
1533
+ result.arg = this.transform(node.arg as any, context);
1534
+ }
1535
+ if (node.fieldnum !== undefined) {
1536
+ result.fieldnum = node.fieldnum;
1537
+ }
1538
+ if (node.resulttype !== undefined) {
1539
+ result.resulttype = node.resulttype;
1540
+ }
1541
+ if (node.resulttypmod !== undefined) {
1542
+ result.resulttypmod = node.resulttypmod;
1543
+ }
1544
+ if (node.resultcollid !== undefined) {
1545
+ result.resultcollid = node.resultcollid;
1546
+ }
1547
+ return { FieldSelect: result };
1548
+ }
1549
+ RelabelType(node: any, context: any): {
1550
+ RelabelType: any;
1551
+ } {
1552
+ const result: any = {};
1553
+ if (node.xpr !== undefined) {
1554
+ result.xpr = this.transform(node.xpr as any, context);
1555
+ }
1556
+ if (node.arg !== undefined) {
1557
+ result.arg = this.transform(node.arg as any, context);
1558
+ }
1559
+ if (node.resulttype !== undefined) {
1560
+ result.resulttype = node.resulttype;
1561
+ }
1562
+ if (node.resulttypmod !== undefined) {
1563
+ result.resulttypmod = node.resulttypmod;
1564
+ }
1565
+ if (node.resultcollid !== undefined) {
1566
+ result.resultcollid = node.resultcollid;
1567
+ }
1568
+ if (node.relabelformat !== undefined) {
1569
+ result.relabelformat = node.relabelformat;
1570
+ }
1571
+ if (node.location !== undefined) {
1572
+ result.location = node.location;
1573
+ }
1574
+ return { RelabelType: result };
1575
+ }
1576
+ CoerceViaIO(node: any, context: any): {
1577
+ CoerceViaIO: any;
1578
+ } {
1579
+ const result: any = {};
1580
+ if (node.xpr !== undefined) {
1581
+ result.xpr = this.transform(node.xpr as any, context);
1582
+ }
1583
+ if (node.arg !== undefined) {
1584
+ result.arg = this.transform(node.arg as any, context);
1585
+ }
1586
+ if (node.resulttype !== undefined) {
1587
+ result.resulttype = node.resulttype;
1588
+ }
1589
+ if (node.resultcollid !== undefined) {
1590
+ result.resultcollid = node.resultcollid;
1591
+ }
1592
+ if (node.coerceformat !== undefined) {
1593
+ result.coerceformat = node.coerceformat;
1594
+ }
1595
+ if (node.location !== undefined) {
1596
+ result.location = node.location;
1597
+ }
1598
+ return { CoerceViaIO: result };
1599
+ }
1600
+ ArrayCoerceExpr(node: any, context: any): {
1601
+ ArrayCoerceExpr: any;
1602
+ } {
1603
+ const result: any = {};
1604
+ if (node.xpr !== undefined) {
1605
+ result.xpr = this.transform(node.xpr as any, context);
1606
+ }
1607
+ if (node.arg !== undefined) {
1608
+ result.arg = this.transform(node.arg as any, context);
1609
+ }
1610
+ if (node.elemexpr !== undefined) {
1611
+ result.elemexpr = this.transform(node.elemexpr as any, context);
1612
+ }
1613
+ if (node.resulttype !== undefined) {
1614
+ result.resulttype = node.resulttype;
1615
+ }
1616
+ if (node.resulttypmod !== undefined) {
1617
+ result.resulttypmod = node.resulttypmod;
1618
+ }
1619
+ if (node.resultcollid !== undefined) {
1620
+ result.resultcollid = node.resultcollid;
1621
+ }
1622
+ if (node.coerceformat !== undefined) {
1623
+ result.coerceformat = node.coerceformat;
1624
+ }
1625
+ if (node.location !== undefined) {
1626
+ result.location = node.location;
1627
+ }
1628
+ return { ArrayCoerceExpr: result };
1629
+ }
1630
+ ConvertRowtypeExpr(node: any, context: any): {
1631
+ ConvertRowtypeExpr: any;
1632
+ } {
1633
+ const result: any = {};
1634
+ if (node.xpr !== undefined) {
1635
+ result.xpr = this.transform(node.xpr as any, context);
1636
+ }
1637
+ if (node.arg !== undefined) {
1638
+ result.arg = this.transform(node.arg as any, context);
1639
+ }
1640
+ if (node.resulttype !== undefined) {
1641
+ result.resulttype = node.resulttype;
1642
+ }
1643
+ if (node.convertformat !== undefined) {
1644
+ result.convertformat = node.convertformat;
1645
+ }
1646
+ if (node.location !== undefined) {
1647
+ result.location = node.location;
1648
+ }
1649
+ return { ConvertRowtypeExpr: result };
1650
+ }
1651
+ NamedArgExpr(node: any, context: any): {
1652
+ NamedArgExpr: any;
1653
+ } {
1654
+ const result: any = {};
1655
+ if (node.xpr !== undefined) {
1656
+ result.xpr = this.transform(node.xpr as any, context);
1657
+ }
1658
+ if (node.arg !== undefined) {
1659
+ result.arg = this.transform(node.arg as any, context);
1660
+ }
1661
+ if (node.name !== undefined) {
1662
+ result.name = node.name;
1663
+ }
1664
+ if (node.argnumber !== undefined) {
1665
+ result.argnumber = node.argnumber;
1666
+ }
1667
+ if (node.location !== undefined) {
1668
+ result.location = node.location;
1669
+ }
1670
+ return { NamedArgExpr: result };
1671
+ }
1672
+ ViewStmt(node: any, context: any): {
1673
+ ViewStmt: any;
1674
+ } {
1675
+ const result: any = {};
1676
+ if (node.view !== undefined) {
1677
+ result.view = this.transform(node.view as any, context);
1678
+ }
1679
+ if (node.aliases !== undefined) {
1680
+ result.aliases = Array.isArray(node.aliases)
1681
+ ? node.aliases.map((item: any) => this.transform(item as any, context))
1682
+ : this.transform(node.aliases as any, context);
1683
+ }
1684
+ if (node.query !== undefined) {
1685
+ result.query = this.transform(node.query as any, context);
1686
+ }
1687
+ if (node.replace !== undefined) {
1688
+ result.replace = node.replace;
1689
+ }
1690
+ if (node.options !== undefined) {
1691
+ result.options = Array.isArray(node.options)
1692
+ ? node.options.map((item: any) => this.transform(item as any, context))
1693
+ : this.transform(node.options as any, context);
1694
+ }
1695
+ if (node.withCheckOption !== undefined) {
1696
+ result.withCheckOption = node.withCheckOption;
1697
+ }
1698
+ return { ViewStmt: result };
1699
+ }
1700
+ IndexStmt(node: any, context: any): {
1701
+ IndexStmt: any;
1702
+ } {
1703
+ const result: any = {};
1704
+ if (node.idxname !== undefined) {
1705
+ result.idxname = node.idxname;
1706
+ }
1707
+ if (node.relation !== undefined) {
1708
+ result.relation = this.transform(node.relation as any, context);
1709
+ }
1710
+ if (node.accessMethod !== undefined) {
1711
+ result.accessMethod = node.accessMethod;
1712
+ }
1713
+ if (node.tableSpace !== undefined) {
1714
+ result.tableSpace = node.tableSpace;
1715
+ }
1716
+ if (node.indexParams !== undefined) {
1717
+ result.indexParams = Array.isArray(node.indexParams)
1718
+ ? node.indexParams.map((item: any) => this.transform(item as any, context))
1719
+ : this.transform(node.indexParams as any, context);
1720
+ }
1721
+ if (node.indexIncludingParams !== undefined) {
1722
+ result.indexIncludingParams = Array.isArray(node.indexIncludingParams)
1723
+ ? node.indexIncludingParams.map((item: any) => this.transform(item as any, context))
1724
+ : this.transform(node.indexIncludingParams as any, context);
1725
+ }
1726
+ if (node.options !== undefined) {
1727
+ result.options = Array.isArray(node.options)
1728
+ ? node.options.map((item: any) => this.transform(item as any, context))
1729
+ : this.transform(node.options as any, context);
1730
+ }
1731
+ if (node.whereClause !== undefined) {
1732
+ result.whereClause = this.transform(node.whereClause as any, context);
1733
+ }
1734
+ if (node.excludeOpNames !== undefined) {
1735
+ result.excludeOpNames = Array.isArray(node.excludeOpNames)
1736
+ ? node.excludeOpNames.map((item: any) => this.transform(item as any, context))
1737
+ : this.transform(node.excludeOpNames as any, context);
1738
+ }
1739
+ if (node.idxcomment !== undefined) {
1740
+ result.idxcomment = node.idxcomment;
1741
+ }
1742
+ if (node.indexOid !== undefined) {
1743
+ result.indexOid = node.indexOid;
1744
+ }
1745
+ if (node.oldNode !== undefined) {
1746
+ result.oldNode = node.oldNode;
1747
+ }
1748
+ if (node.oldCreateSubid !== undefined) {
1749
+ result.oldCreateSubid = node.oldCreateSubid;
1750
+ }
1751
+ if (node.oldFirstRelfilenodeSubid !== undefined) {
1752
+ result.oldFirstRelfilenodeSubid = node.oldFirstRelfilenodeSubid;
1753
+ }
1754
+ if (node.unique !== undefined) {
1755
+ result.unique = node.unique;
1756
+ }
1757
+ if (node.primary !== undefined) {
1758
+ result.primary = node.primary;
1759
+ }
1760
+ if (node.isconstraint !== undefined) {
1761
+ result.isconstraint = node.isconstraint;
1762
+ }
1763
+ if (node.deferrable !== undefined) {
1764
+ result.deferrable = node.deferrable;
1765
+ }
1766
+ if (node.initdeferred !== undefined) {
1767
+ result.initdeferred = node.initdeferred;
1768
+ }
1769
+ if (node.transformed !== undefined) {
1770
+ result.transformed = node.transformed;
1771
+ }
1772
+ if (node.concurrent !== undefined) {
1773
+ result.concurrent = node.concurrent;
1774
+ }
1775
+ if (node.if_not_exists !== undefined) {
1776
+ result.if_not_exists = node.if_not_exists;
1777
+ }
1778
+ if (node.reset_default_tblspc !== undefined) {
1779
+ result.reset_default_tblspc = node.reset_default_tblspc;
1780
+ }
1781
+ return { IndexStmt: result };
1782
+ }
1783
+ IndexElem(node: any, context: any): {
1784
+ IndexElem: any;
1785
+ } {
1786
+ const result: any = {};
1787
+ if (node.name !== undefined) {
1788
+ result.name = node.name;
1789
+ }
1790
+ if (node.expr !== undefined) {
1791
+ result.expr = this.transform(node.expr as any, context);
1792
+ }
1793
+ if (node.indexcolname !== undefined) {
1794
+ result.indexcolname = node.indexcolname;
1795
+ }
1796
+ if (node.collation !== undefined) {
1797
+ result.collation = Array.isArray(node.collation)
1798
+ ? node.collation.map((item: any) => this.transform(item as any, context))
1799
+ : this.transform(node.collation as any, context);
1800
+ }
1801
+ if (node.opclass !== undefined) {
1802
+ result.opclass = Array.isArray(node.opclass)
1803
+ ? node.opclass.map((item: any) => this.transform(item as any, context))
1804
+ : this.transform(node.opclass as any, context);
1805
+ }
1806
+ if (node.opclassopts !== undefined) {
1807
+ result.opclassopts = Array.isArray(node.opclassopts)
1808
+ ? node.opclassopts.map((item: any) => this.transform(item as any, context))
1809
+ : this.transform(node.opclassopts as any, context);
1810
+ }
1811
+ if (node.ordering !== undefined) {
1812
+ result.ordering = node.ordering;
1813
+ }
1814
+ if (node.nulls_ordering !== undefined) {
1815
+ result.nulls_ordering = node.nulls_ordering;
1816
+ }
1817
+ return { IndexElem: result };
1818
+ }
1819
+ PartitionElem(node: any, context: any): {
1820
+ PartitionElem: any;
1821
+ } {
1822
+ const result: any = {};
1823
+ if (node.name !== undefined) {
1824
+ result.name = node.name;
1825
+ }
1826
+ if (node.expr !== undefined) {
1827
+ result.expr = this.transform(node.expr as any, context);
1828
+ }
1829
+ if (node.collation !== undefined) {
1830
+ result.collation = Array.isArray(node.collation)
1831
+ ? node.collation.map((item: any) => this.transform(item as any, context))
1832
+ : this.transform(node.collation as any, context);
1833
+ }
1834
+ if (node.opclass !== undefined) {
1835
+ result.opclass = Array.isArray(node.opclass)
1836
+ ? node.opclass.map((item: any) => this.transform(item as any, context))
1837
+ : this.transform(node.opclass as any, context);
1838
+ }
1839
+ if (node.location !== undefined) {
1840
+ result.location = node.location;
1841
+ }
1842
+ return { PartitionElem: result };
1843
+ }
1844
+ PartitionCmd(node: any, context: any): {
1845
+ PartitionCmd: any;
1846
+ } {
1847
+ const result: any = {};
1848
+ if (node.name !== undefined) {
1849
+ result.name = this.transform(node.name as any, context);
1850
+ }
1851
+ if (node.bound !== undefined) {
1852
+ result.bound = this.transform(node.bound as any, context);
1853
+ }
1854
+ if (node.concurrent !== undefined) {
1855
+ result.concurrent = node.concurrent;
1856
+ }
1857
+ return { PartitionCmd: result };
1858
+ }
1859
+ JoinExpr(node: any, context: any): {
1860
+ JoinExpr: any;
1861
+ } {
1862
+ const result: any = {};
1863
+ if (node.jointype !== undefined) {
1864
+ result.jointype = node.jointype;
1865
+ }
1866
+ if (node.isNatural !== undefined) {
1867
+ result.isNatural = node.isNatural;
1868
+ }
1869
+ if (node.larg !== undefined) {
1870
+ result.larg = this.transform(node.larg as any, context);
1871
+ }
1872
+ if (node.rarg !== undefined) {
1873
+ result.rarg = this.transform(node.rarg as any, context);
1874
+ }
1875
+ if (node.usingClause !== undefined) {
1876
+ result.usingClause = Array.isArray(node.usingClause)
1877
+ ? node.usingClause.map((item: any) => this.transform(item as any, context))
1878
+ : this.transform(node.usingClause as any, context);
1879
+ }
1880
+ if (node.join_using_alias !== undefined) {
1881
+ result.join_using_alias = this.transform(node.join_using_alias as any, context);
1882
+ }
1883
+ if (node.quals !== undefined) {
1884
+ result.quals = this.transform(node.quals as any, context);
1885
+ }
1886
+ if (node.alias !== undefined) {
1887
+ result.alias = this.transform(node.alias as any, context);
1888
+ }
1889
+ if (node.rtindex !== undefined) {
1890
+ result.rtindex = node.rtindex;
1891
+ }
1892
+ return { JoinExpr: result };
1893
+ }
1894
+ FromExpr(node: any, context: any): {
1895
+ FromExpr: any;
1896
+ } {
1897
+ const result: any = {};
1898
+ if (node.fromlist !== undefined) {
1899
+ result.fromlist = Array.isArray(node.fromlist)
1900
+ ? node.fromlist.map((item: any) => this.transform(item as any, context))
1901
+ : this.transform(node.fromlist as any, context);
1902
+ }
1903
+ if (node.quals !== undefined) {
1904
+ result.quals = this.transform(node.quals as any, context);
1905
+ }
1906
+ return { FromExpr: result };
1907
+ }
1908
+ TransactionStmt(node: any, context: any): {
1909
+ TransactionStmt: any;
1910
+ } {
1911
+ const result: any = {};
1912
+ if (node.kind !== undefined) {
1913
+ result.kind = node.kind;
1914
+ }
1915
+ if (node.options !== undefined) {
1916
+ result.options = Array.isArray(node.options)
1917
+ ? node.options.map((item: any) => this.transform(item as any, context))
1918
+ : this.transform(node.options as any, context);
1919
+ }
1920
+ if (node.savepoint_name !== undefined) {
1921
+ result.savepoint_name = node.savepoint_name;
1922
+ }
1923
+ if (node.gid !== undefined) {
1924
+ result.gid = node.gid;
1925
+ }
1926
+ if (node.chain !== undefined) {
1927
+ result.chain = node.chain;
1928
+ }
1929
+ return { TransactionStmt: result };
1930
+ }
1931
+ VariableSetStmt(node: any, context: any): {
1932
+ VariableSetStmt: any;
1933
+ } {
1934
+ const result: any = {};
1935
+ if (node.kind !== undefined) {
1936
+ result.kind = node.kind;
1937
+ }
1938
+ if (node.name !== undefined) {
1939
+ result.name = node.name;
1940
+ }
1941
+ if (node.args !== undefined) {
1942
+ result.args = Array.isArray(node.args)
1943
+ ? node.args.map((item: any) => this.transform(item as any, context))
1944
+ : this.transform(node.args as any, context);
1945
+ }
1946
+ if (node.is_local !== undefined) {
1947
+ result.is_local = node.is_local;
1948
+ }
1949
+ return { VariableSetStmt: result };
1950
+ }
1951
+ VariableShowStmt(node: any, context: any): {
1952
+ VariableShowStmt: any;
1953
+ } {
1954
+ const result: any = {};
1955
+ if (node.name !== undefined) {
1956
+ result.name = node.name;
1957
+ }
1958
+ return { VariableShowStmt: result };
1959
+ }
1960
+ CreateSchemaStmt(node: any, context: any): {
1961
+ CreateSchemaStmt: any;
1962
+ } {
1963
+ const result: any = {};
1964
+ if (node.schemaname !== undefined) {
1965
+ result.schemaname = node.schemaname;
1966
+ }
1967
+ if (node.authrole !== undefined) {
1968
+ result.authrole = this.transform(node.authrole as any, context);
1969
+ }
1970
+ if (node.schemaElts !== undefined) {
1971
+ result.schemaElts = Array.isArray(node.schemaElts)
1972
+ ? node.schemaElts.map((item: any) => this.transform(item as any, context))
1973
+ : this.transform(node.schemaElts as any, context);
1974
+ }
1975
+ if (node.if_not_exists !== undefined) {
1976
+ result.if_not_exists = node.if_not_exists;
1977
+ }
1978
+ return { CreateSchemaStmt: result };
1979
+ }
1980
+ RoleSpec(node: any, context: any): {
1981
+ RoleSpec: any;
1982
+ } {
1983
+ const result: any = {};
1984
+ if (node.roletype !== undefined) {
1985
+ result.roletype = node.roletype;
1986
+ }
1987
+ if (node.rolename !== undefined) {
1988
+ result.rolename = node.rolename;
1989
+ }
1990
+ if (node.location !== undefined) {
1991
+ result.location = node.location;
1992
+ }
1993
+ return { RoleSpec: result };
1994
+ }
1995
+ DropStmt(node: any, context: any): {
1996
+ DropStmt: any;
1997
+ } {
1998
+ const result: any = {};
1999
+ if (node.objects !== undefined) {
2000
+ result.objects = Array.isArray(node.objects)
2001
+ ? node.objects.map((item: any) => this.transform(item as any, context))
2002
+ : this.transform(node.objects as any, context);
2003
+ }
2004
+ if (node.removeType !== undefined) {
2005
+ result.removeType = node.removeType;
2006
+ }
2007
+ if (node.behavior !== undefined) {
2008
+ result.behavior = node.behavior;
2009
+ }
2010
+ if (node.missing_ok !== undefined) {
2011
+ result.missing_ok = node.missing_ok;
2012
+ }
2013
+ if (node.concurrent !== undefined) {
2014
+ result.concurrent = node.concurrent;
2015
+ }
2016
+ return { DropStmt: result };
2017
+ }
2018
+ TruncateStmt(node: any, context: any): {
2019
+ TruncateStmt: any;
2020
+ } {
2021
+ const result: any = {};
2022
+ if (node.relations !== undefined) {
2023
+ result.relations = Array.isArray(node.relations)
2024
+ ? node.relations.map((item: any) => this.transform(item as any, context))
2025
+ : this.transform(node.relations as any, context);
2026
+ }
2027
+ if (node.restart_seqs !== undefined) {
2028
+ result.restart_seqs = node.restart_seqs;
2029
+ }
2030
+ if (node.behavior !== undefined) {
2031
+ result.behavior = node.behavior;
2032
+ }
2033
+ return { TruncateStmt: result };
2034
+ }
2035
+ ReturnStmt(node: any, context: any): {
2036
+ ReturnStmt: any;
2037
+ } {
2038
+ const result: any = {};
2039
+ if (node.returnval !== undefined) {
2040
+ result.returnval = this.transform(node.returnval as any, context);
2041
+ }
2042
+ return { ReturnStmt: result };
2043
+ }
2044
+ PLAssignStmt(node: any, context: any): {
2045
+ PLAssignStmt: any;
2046
+ } {
2047
+ const result: any = {};
2048
+ if (node.name !== undefined) {
2049
+ result.name = node.name;
2050
+ }
2051
+ if (node.indirection !== undefined) {
2052
+ result.indirection = Array.isArray(node.indirection)
2053
+ ? node.indirection.map((item: any) => this.transform(item as any, context))
2054
+ : this.transform(node.indirection as any, context);
2055
+ }
2056
+ if (node.nnames !== undefined) {
2057
+ result.nnames = node.nnames;
2058
+ }
2059
+ if (node.val !== undefined) {
2060
+ result.val = this.transform(node.val as any, context);
2061
+ }
2062
+ if (node.location !== undefined) {
2063
+ result.location = node.location;
2064
+ }
2065
+ return { PLAssignStmt: result };
2066
+ }
2067
+ CopyStmt(node: any, context: any): {
2068
+ CopyStmt: any;
2069
+ } {
2070
+ const result: any = {};
2071
+ if (node.relation !== undefined) {
2072
+ result.relation = this.transform(node.relation as any, context);
2073
+ }
2074
+ if (node.query !== undefined) {
2075
+ result.query = this.transform(node.query as any, context);
2076
+ }
2077
+ if (node.attlist !== undefined) {
2078
+ result.attlist = Array.isArray(node.attlist)
2079
+ ? node.attlist.map((item: any) => this.transform(item as any, context))
2080
+ : this.transform(node.attlist as any, context);
2081
+ }
2082
+ if (node.is_from !== undefined) {
2083
+ result.is_from = node.is_from;
2084
+ }
2085
+ if (node.is_program !== undefined) {
2086
+ result.is_program = node.is_program;
2087
+ }
2088
+ if (node.filename !== undefined) {
2089
+ result.filename = node.filename;
2090
+ }
2091
+ if (node.options !== undefined) {
2092
+ result.options = Array.isArray(node.options)
2093
+ ? node.options.map((item: any) => this.transform(item as any, context))
2094
+ : this.transform(node.options as any, context);
2095
+ }
2096
+ if (node.whereClause !== undefined) {
2097
+ result.whereClause = this.transform(node.whereClause as any, context);
2098
+ }
2099
+ return { CopyStmt: result };
2100
+ }
2101
+ AlterTableStmt(node: any, context: any): {
2102
+ AlterTableStmt: any;
2103
+ } {
2104
+ const result: any = {};
2105
+ if (node.relation !== undefined) {
2106
+ result.relation = this.transform(node.relation as any, context);
2107
+ }
2108
+ if (node.cmds !== undefined) {
2109
+ result.cmds = Array.isArray(node.cmds)
2110
+ ? node.cmds.map((item: any) => this.transform(item as any, context))
2111
+ : this.transform(node.cmds as any, context);
2112
+ }
2113
+ if (node.objtype !== undefined) {
2114
+ result.objtype = node.objtype;
2115
+ }
2116
+ if (node.missing_ok !== undefined) {
2117
+ result.missing_ok = node.missing_ok;
2118
+ }
2119
+ return { AlterTableStmt: result };
2120
+ }
2121
+ AlterTableCmd(node: any, context: any): {
2122
+ AlterTableCmd: any;
2123
+ } {
2124
+ const result: any = {};
2125
+ if (node.subtype !== undefined) {
2126
+ result.subtype = node.subtype;
2127
+ }
2128
+ if (node.name !== undefined) {
2129
+ result.name = node.name;
2130
+ }
2131
+ if (node.num !== undefined) {
2132
+ result.num = node.num;
2133
+ }
2134
+ if (node.newowner !== undefined) {
2135
+ result.newowner = this.transform(node.newowner as any, context);
2136
+ }
2137
+ if (node.def !== undefined) {
2138
+ result.def = this.transform(node.def as any, context);
2139
+ }
2140
+ if (node.behavior !== undefined) {
2141
+ result.behavior = node.behavior;
2142
+ }
2143
+ if (node.missing_ok !== undefined) {
2144
+ result.missing_ok = node.missing_ok;
2145
+ }
2146
+ return { AlterTableCmd: result };
2147
+ }
2148
+ CreateFunctionStmt(node: any, context: any): {
2149
+ CreateFunctionStmt: any;
2150
+ } {
2151
+ const result: any = {};
2152
+ if (node.is_procedure !== undefined) {
2153
+ result.is_procedure = node.is_procedure;
2154
+ }
2155
+ if (node.replace !== undefined) {
2156
+ result.replace = node.replace;
2157
+ }
2158
+ if (node.funcname !== undefined) {
2159
+ result.funcname = Array.isArray(node.funcname)
2160
+ ? node.funcname.map((item: any) => this.transform(item as any, context))
2161
+ : this.transform(node.funcname as any, context);
2162
+ }
2163
+ if (node.parameters !== undefined) {
2164
+ result.parameters = Array.isArray(node.parameters)
2165
+ ? node.parameters.map((item: any) => this.transform(item as any, context))
2166
+ : this.transform(node.parameters as any, context);
2167
+ }
2168
+ if (node.returnType !== undefined) {
2169
+ result.returnType = this.transform(node.returnType as any, context);
2170
+ }
2171
+ if (node.options !== undefined) {
2172
+ result.options = Array.isArray(node.options)
2173
+ ? node.options.map((item: any) => this.transform(item as any, context))
2174
+ : this.transform(node.options as any, context);
2175
+ }
2176
+ if (node.sql_body !== undefined) {
2177
+ result.sql_body = this.transform(node.sql_body as any, context);
2178
+ }
2179
+ return { CreateFunctionStmt: result };
2180
+ }
2181
+ FunctionParameter(node: any, context: any): {
2182
+ FunctionParameter: any;
2183
+ } {
2184
+ const result: any = {};
2185
+ if (node.name !== undefined) {
2186
+ result.name = node.name;
2187
+ }
2188
+ if (node.argType !== undefined) {
2189
+ result.argType = this.transform(node.argType as any, context);
2190
+ }
2191
+ if (node.mode !== undefined) {
2192
+ result.mode = node.mode;
2193
+ }
2194
+ if (node.defexpr !== undefined) {
2195
+ result.defexpr = this.transform(node.defexpr as any, context);
2196
+ }
2197
+ return { FunctionParameter: result };
2198
+ }
2199
+ CompositeTypeStmt(node: any, context: any): {
2200
+ CompositeTypeStmt: any;
2201
+ } {
2202
+ const result: any = {};
2203
+ if (node.typevar !== undefined) {
2204
+ result.typevar = this.transform(node.typevar as any, context);
2205
+ }
2206
+ if (node.coldeflist !== undefined) {
2207
+ result.coldeflist = Array.isArray(node.coldeflist)
2208
+ ? node.coldeflist.map((item: any) => this.transform(item as any, context))
2209
+ : this.transform(node.coldeflist as any, context);
2210
+ }
2211
+ return { CompositeTypeStmt: result };
2212
+ }
2213
+ DoStmt(node: any, context: any): {
2214
+ DoStmt: any;
2215
+ } {
2216
+ const result: any = {};
2217
+ if (node.args !== undefined) {
2218
+ result.args = Array.isArray(node.args)
2219
+ ? node.args.map((item: any) => this.transform(item as any, context))
2220
+ : this.transform(node.args as any, context);
2221
+ }
2222
+ return { DoStmt: result };
2223
+ }
2224
+ DefineStmt(node: any, context: any): {
2225
+ DefineStmt: any;
2226
+ } {
2227
+ const result: any = {};
2228
+ if (node.kind !== undefined) {
2229
+ result.kind = node.kind;
2230
+ }
2231
+ if (node.oldstyle !== undefined) {
2232
+ result.oldstyle = node.oldstyle;
2233
+ }
2234
+ if (node.defnames !== undefined) {
2235
+ result.defnames = Array.isArray(node.defnames)
2236
+ ? node.defnames.map((item: any) => this.transform(item as any, context))
2237
+ : this.transform(node.defnames as any, context);
2238
+ }
2239
+ if (node.args !== undefined) {
2240
+ result.args = Array.isArray(node.args)
2241
+ ? node.args.map((item: any) => this.transform(item as any, context))
2242
+ : this.transform(node.args as any, context);
2243
+ }
2244
+ if (node.definition !== undefined) {
2245
+ result.definition = Array.isArray(node.definition)
2246
+ ? node.definition.map((item: any) => this.transform(item as any, context))
2247
+ : this.transform(node.definition as any, context);
2248
+ }
2249
+ if (node.if_not_exists !== undefined) {
2250
+ result.if_not_exists = node.if_not_exists;
2251
+ }
2252
+ if (node.replace !== undefined) {
2253
+ result.replace = node.replace;
2254
+ }
2255
+ return { DefineStmt: result };
2256
+ }
2257
+ RangeSubselect(node: any, context: any): {
2258
+ RangeSubselect: any;
2259
+ } {
2260
+ const result: any = {};
2261
+ if (node.lateral !== undefined) {
2262
+ result.lateral = node.lateral;
2263
+ }
2264
+ if (node.subquery !== undefined) {
2265
+ result.subquery = this.transform(node.subquery as any, context);
2266
+ }
2267
+ if (node.alias !== undefined) {
2268
+ result.alias = this.transform(node.alias as any, context);
2269
+ }
2270
+ return { RangeSubselect: result };
2271
+ }
2272
+ CreateEnumStmt(node: any, context: any): {
2273
+ CreateEnumStmt: any;
2274
+ } {
2275
+ const result: any = {};
2276
+ if (node.typeName !== undefined) {
2277
+ result.typeName = Array.isArray(node.typeName)
2278
+ ? node.typeName.map((item: any) => this.transform(item as any, context))
2279
+ : this.transform(node.typeName as any, context);
2280
+ }
2281
+ if (node.vals !== undefined) {
2282
+ result.vals = Array.isArray(node.vals)
2283
+ ? node.vals.map((item: any) => this.transform(item as any, context))
2284
+ : this.transform(node.vals as any, context);
2285
+ }
2286
+ return { CreateEnumStmt: result };
2287
+ }
2288
+ CreateDomainStmt(node: any, context: any): {
2289
+ CreateDomainStmt: any;
2290
+ } {
2291
+ const result: any = {};
2292
+ if (node.domainname !== undefined) {
2293
+ result.domainname = Array.isArray(node.domainname)
2294
+ ? node.domainname.map((item: any) => this.transform(item as any, context))
2295
+ : this.transform(node.domainname as any, context);
2296
+ }
2297
+ if (node.typeName !== undefined) {
2298
+ result.typeName = this.transform(node.typeName as any, context);
2299
+ }
2300
+ if (node.collClause !== undefined) {
2301
+ result.collClause = this.transform(node.collClause as any, context);
2302
+ }
2303
+ if (node.constraints !== undefined) {
2304
+ result.constraints = Array.isArray(node.constraints)
2305
+ ? node.constraints.map((item: any) => this.transform(item as any, context))
2306
+ : this.transform(node.constraints as any, context);
2307
+ }
2308
+ return { CreateDomainStmt: result };
2309
+ }
2310
+ CreateRoleStmt(node: any, context: any): {
2311
+ CreateRoleStmt: any;
2312
+ } {
2313
+ const result: any = {};
2314
+ if (node.stmt_type !== undefined) {
2315
+ result.stmt_type = node.stmt_type;
2316
+ }
2317
+ if (node.role !== undefined) {
2318
+ result.role = node.role;
2319
+ }
2320
+ if (node.options !== undefined) {
2321
+ result.options = Array.isArray(node.options)
2322
+ ? node.options.map((item: any) => this.transform(item as any, context))
2323
+ : this.transform(node.options as any, context);
2324
+ }
2325
+ return { CreateRoleStmt: result };
2326
+ }
2327
+ DefElem(node: any, context: any): {
2328
+ DefElem: any;
2329
+ } {
2330
+ const result: any = {};
2331
+ if (node.defnamespace !== undefined) {
2332
+ result.defnamespace = node.defnamespace;
2333
+ }
2334
+ if (node.defname !== undefined) {
2335
+ result.defname = node.defname;
2336
+ }
2337
+ if (node.arg !== undefined) {
2338
+ result.arg = this.transform(node.arg as any, context);
2339
+ }
2340
+ if (node.defaction !== undefined) {
2341
+ result.defaction = node.defaction;
2342
+ }
2343
+ if (node.location !== undefined) {
2344
+ result.location = node.location;
2345
+ }
2346
+ return { DefElem: result };
2347
+ }
2348
+ CreateTableSpaceStmt(node: any, context: any): {
2349
+ CreateTableSpaceStmt: any;
2350
+ } {
2351
+ const result: any = {};
2352
+ if (node.tablespacename !== undefined) {
2353
+ result.tablespacename = node.tablespacename;
2354
+ }
2355
+ if (node.owner !== undefined) {
2356
+ result.owner = this.transform(node.owner as any, context);
2357
+ }
2358
+ if (node.location !== undefined) {
2359
+ result.location = node.location;
2360
+ }
2361
+ if (node.options !== undefined) {
2362
+ result.options = Array.isArray(node.options)
2363
+ ? node.options.map((item: any) => this.transform(item as any, context))
2364
+ : this.transform(node.options as any, context);
2365
+ }
2366
+ return { CreateTableSpaceStmt: result };
2367
+ }
2368
+ DropTableSpaceStmt(node: any, context: any): {
2369
+ DropTableSpaceStmt: any;
2370
+ } {
2371
+ const result: any = {};
2372
+ if (node.tablespacename !== undefined) {
2373
+ result.tablespacename = node.tablespacename;
2374
+ }
2375
+ if (node.missing_ok !== undefined) {
2376
+ result.missing_ok = node.missing_ok;
2377
+ }
2378
+ return { DropTableSpaceStmt: result };
2379
+ }
2380
+ AlterTableSpaceOptionsStmt(node: any, context: any): {
2381
+ AlterTableSpaceOptionsStmt: any;
2382
+ } {
2383
+ const result: any = {};
2384
+ if (node.tablespacename !== undefined) {
2385
+ result.tablespacename = node.tablespacename;
2386
+ }
2387
+ if (node.options !== undefined) {
2388
+ result.options = Array.isArray(node.options)
2389
+ ? node.options.map((item: any) => this.transform(item as any, context))
2390
+ : this.transform(node.options as any, context);
2391
+ }
2392
+ if (node.isReset !== undefined) {
2393
+ result.isReset = node.isReset;
2394
+ }
2395
+ return { AlterTableSpaceOptionsStmt: result };
2396
+ }
2397
+ CreateExtensionStmt(node: any, context: any): {
2398
+ CreateExtensionStmt: any;
2399
+ } {
2400
+ const result: any = {};
2401
+ if (node.extname !== undefined) {
2402
+ result.extname = node.extname;
2403
+ }
2404
+ if (node.if_not_exists !== undefined) {
2405
+ result.if_not_exists = node.if_not_exists;
2406
+ }
2407
+ if (node.options !== undefined) {
2408
+ result.options = Array.isArray(node.options)
2409
+ ? node.options.map((item: any) => this.transform(item as any, context))
2410
+ : this.transform(node.options as any, context);
2411
+ }
2412
+ return { CreateExtensionStmt: result };
2413
+ }
2414
+ AlterExtensionStmt(node: any, context: any): {
2415
+ AlterExtensionStmt: any;
2416
+ } {
2417
+ const result: any = {};
2418
+ if (node.extname !== undefined) {
2419
+ result.extname = node.extname;
2420
+ }
2421
+ if (node.options !== undefined) {
2422
+ result.options = Array.isArray(node.options)
2423
+ ? node.options.map((item: any) => this.transform(item as any, context))
2424
+ : this.transform(node.options as any, context);
2425
+ }
2426
+ return { AlterExtensionStmt: result };
2427
+ }
2428
+ CreateFdwStmt(node: any, context: any): {
2429
+ CreateFdwStmt: any;
2430
+ } {
2431
+ const result: any = { ...node };
2432
+ return { CreateFdwStmt: result };
2433
+ }
2434
+ SetOperationStmt(node: any, context: any): {
2435
+ SetOperationStmt: any;
2436
+ } {
2437
+ const result: any = { ...node };
2438
+ return { SetOperationStmt: result };
2439
+ }
2440
+ ReplicaIdentityStmt(node: any, context: any): {
2441
+ ReplicaIdentityStmt: any;
2442
+ } {
2443
+ const result: any = { ...node };
2444
+ return { ReplicaIdentityStmt: result };
2445
+ }
2446
+ AlterCollationStmt(node: any, context: any): {
2447
+ AlterCollationStmt: any;
2448
+ } {
2449
+ const result: any = { ...node };
2450
+ return { AlterCollationStmt: result };
2451
+ }
2452
+ AlterDomainStmt(node: any, context: any): {
2453
+ AlterDomainStmt: any;
2454
+ } {
2455
+ const result: any = { ...node };
2456
+ return { AlterDomainStmt: result };
2457
+ }
2458
+ PrepareStmt(node: any, context: any): {
2459
+ PrepareStmt: any;
2460
+ } {
2461
+ const result: any = { ...node };
2462
+ return { PrepareStmt: result };
2463
+ }
2464
+ ExecuteStmt(node: any, context: any): {
2465
+ ExecuteStmt: any;
2466
+ } {
2467
+ const result: any = { ...node };
2468
+ return { ExecuteStmt: result };
2469
+ }
2470
+ DeallocateStmt(node: any, context: any): {
2471
+ DeallocateStmt: any;
2472
+ } {
2473
+ const result: any = { ...node };
2474
+ return { DeallocateStmt: result };
2475
+ }
2476
+ NotifyStmt(node: any, context: any): {
2477
+ NotifyStmt: any;
2478
+ } {
2479
+ const result: any = { ...node };
2480
+ return { NotifyStmt: result };
2481
+ }
2482
+ ListenStmt(node: any, context: any): {
2483
+ ListenStmt: any;
2484
+ } {
2485
+ const result: any = { ...node };
2486
+ return { ListenStmt: result };
2487
+ }
2488
+ UnlistenStmt(node: any, context: any): {
2489
+ UnlistenStmt: any;
2490
+ } {
2491
+ const result: any = { ...node };
2492
+ return { UnlistenStmt: result };
2493
+ }
2494
+ CheckPointStmt(node: any, context: any): {
2495
+ CheckPointStmt: any;
2496
+ } {
2497
+ const result: any = { ...node };
2498
+ return { CheckPointStmt: result };
2499
+ }
2500
+ LoadStmt(node: any, context: any): {
2501
+ LoadStmt: any;
2502
+ } {
2503
+ const result: any = { ...node };
2504
+ return { LoadStmt: result };
2505
+ }
2506
+ DiscardStmt(node: any, context: any): {
2507
+ DiscardStmt: any;
2508
+ } {
2509
+ const result: any = { ...node };
2510
+ return { DiscardStmt: result };
2511
+ }
2512
+ CommentStmt(node: any, context: any): {
2513
+ CommentStmt: any;
2514
+ } {
2515
+ const result: any = {};
2516
+ if (node.objtype !== undefined) {
2517
+ result.objtype = node.objtype;
2518
+ }
2519
+ if (node.object !== undefined) {
2520
+ result.object = this.transform(node.object as any, context);
2521
+ }
2522
+ if (node.comment !== undefined) {
2523
+ result.comment = node.comment;
2524
+ }
2525
+ return { CommentStmt: result };
2526
+ }
2527
+ LockStmt(node: any, context: any): {
2528
+ LockStmt: any;
2529
+ } {
2530
+ const result: any = { ...node };
2531
+ return { LockStmt: result };
2532
+ }
2533
+ CreatePolicyStmt(node: any, context: any): {
2534
+ CreatePolicyStmt: any;
2535
+ } {
2536
+ const result: any = { ...node };
2537
+ return { CreatePolicyStmt: result };
2538
+ }
2539
+ AlterPolicyStmt(node: any, context: any): {
2540
+ AlterPolicyStmt: any;
2541
+ } {
2542
+ const result: any = { ...node };
2543
+ return { AlterPolicyStmt: result };
2544
+ }
2545
+ CreateUserMappingStmt(node: any, context: any): {
2546
+ CreateUserMappingStmt: any;
2547
+ } {
2548
+ const result: any = { ...node };
2549
+ return { CreateUserMappingStmt: result };
2550
+ }
2551
+ CreateStatsStmt(node: any, context: any): {
2552
+ CreateStatsStmt: any;
2553
+ } {
2554
+ const result: any = { ...node };
2555
+ return { CreateStatsStmt: result };
2556
+ }
2557
+ StatsElem(node: any, context: any): {
2558
+ StatsElem: any;
2559
+ } {
2560
+ const result: any = { ...node };
2561
+ return { StatsElem: result };
2562
+ }
2563
+ CreatePublicationStmt(node: any, context: any): {
2564
+ CreatePublicationStmt: any;
2565
+ } {
2566
+ const result: any = { ...node };
2567
+ return { CreatePublicationStmt: result };
2568
+ }
2569
+ CreateSubscriptionStmt(node: any, context: any): {
2570
+ CreateSubscriptionStmt: any;
2571
+ } {
2572
+ const result: any = { ...node };
2573
+ return { CreateSubscriptionStmt: result };
2574
+ }
2575
+ AlterPublicationStmt(node: any, context: any): {
2576
+ AlterPublicationStmt: any;
2577
+ } {
2578
+ const result: any = { ...node };
2579
+ return { AlterPublicationStmt: result };
2580
+ }
2581
+ AlterSubscriptionStmt(node: any, context: any): {
2582
+ AlterSubscriptionStmt: any;
2583
+ } {
2584
+ const result: any = { ...node };
2585
+ return { AlterSubscriptionStmt: result };
2586
+ }
2587
+ DropSubscriptionStmt(node: any, context: any): {
2588
+ DropSubscriptionStmt: any;
2589
+ } {
2590
+ const result: any = { ...node };
2591
+ return { DropSubscriptionStmt: result };
2592
+ }
2593
+ InlineCodeBlock(node: any, context: any): {
2594
+ InlineCodeBlock: any;
2595
+ } {
2596
+ const result: any = { ...node };
2597
+ return { InlineCodeBlock: result };
2598
+ }
2599
+ CallContext(node: any, context: any): {
2600
+ CallContext: any;
2601
+ } {
2602
+ const result: any = { ...node };
2603
+ return { CallContext: result };
2604
+ }
2605
+ ConstraintsSetStmt(node: any, context: any): {
2606
+ ConstraintsSetStmt: any;
2607
+ } {
2608
+ const result: any = { ...node };
2609
+ return { ConstraintsSetStmt: result };
2610
+ }
2611
+ AlterSystemStmt(node: any, context: any): {
2612
+ AlterSystemStmt: any;
2613
+ } {
2614
+ const result: any = { ...node };
2615
+ return { AlterSystemStmt: result };
2616
+ }
2617
+ VacuumRelation(node: any, context: any): {
2618
+ VacuumRelation: any;
2619
+ } {
2620
+ const result: any = { ...node };
2621
+ return { VacuumRelation: result };
2622
+ }
2623
+ DropOwnedStmt(node: any, context: any): {
2624
+ DropOwnedStmt: any;
2625
+ } {
2626
+ const result: any = { ...node };
2627
+ return { DropOwnedStmt: result };
2628
+ }
2629
+ ReassignOwnedStmt(node: any, context: any): {
2630
+ ReassignOwnedStmt: any;
2631
+ } {
2632
+ const result: any = { ...node };
2633
+ return { ReassignOwnedStmt: result };
2634
+ }
2635
+ AlterTSDictionaryStmt(node: any, context: any): {
2636
+ AlterTSDictionaryStmt: any;
2637
+ } {
2638
+ const result: any = { ...node };
2639
+ return { AlterTSDictionaryStmt: result };
2640
+ }
2641
+ AlterTSConfigurationStmt(node: any, context: any): {
2642
+ AlterTSConfigurationStmt: any;
2643
+ } {
2644
+ const result: any = { ...node };
2645
+ return { AlterTSConfigurationStmt: result };
2646
+ }
2647
+ ClosePortalStmt(node: any, context: any): {
2648
+ ClosePortalStmt: any;
2649
+ } {
2650
+ const result: any = { ...node };
2651
+ return { ClosePortalStmt: result };
2652
+ }
2653
+ FetchStmt(node: any, context: any): {
2654
+ FetchStmt: any;
2655
+ } {
2656
+ const result: any = { ...node };
2657
+ return { FetchStmt: result };
2658
+ }
2659
+ AlterStatsStmt(node: any, context: any): {
2660
+ AlterStatsStmt: any;
2661
+ } {
2662
+ const result: any = { ...node };
2663
+ return { AlterStatsStmt: result };
2664
+ }
2665
+ ObjectWithArgs(node: any, context: any): {
2666
+ ObjectWithArgs: any;
2667
+ } {
2668
+ const result: any = { ...node };
2669
+ return { ObjectWithArgs: result };
2670
+ }
2671
+ AlterOperatorStmt(node: any, context: any): {
2672
+ AlterOperatorStmt: any;
2673
+ } {
2674
+ const result: any = { ...node };
2675
+ return { AlterOperatorStmt: result };
2676
+ }
2677
+ AlterFdwStmt(node: any, context: any): {
2678
+ AlterFdwStmt: any;
2679
+ } {
2680
+ const result: any = { ...node };
2681
+ return { AlterFdwStmt: result };
2682
+ }
2683
+ CreateForeignServerStmt(node: any, context: any): {
2684
+ CreateForeignServerStmt: any;
2685
+ } {
2686
+ const result: any = { ...node };
2687
+ return { CreateForeignServerStmt: result };
2688
+ }
2689
+ AlterForeignServerStmt(node: any, context: any): {
2690
+ AlterForeignServerStmt: any;
2691
+ } {
2692
+ const result: any = { ...node };
2693
+ return { AlterForeignServerStmt: result };
2694
+ }
2695
+ AlterUserMappingStmt(node: any, context: any): {
2696
+ AlterUserMappingStmt: any;
2697
+ } {
2698
+ const result: any = { ...node };
2699
+ return { AlterUserMappingStmt: result };
2700
+ }
2701
+ DropUserMappingStmt(node: any, context: any): {
2702
+ DropUserMappingStmt: any;
2703
+ } {
2704
+ const result: any = { ...node };
2705
+ return { DropUserMappingStmt: result };
2706
+ }
2707
+ ImportForeignSchemaStmt(node: any, context: any): {
2708
+ ImportForeignSchemaStmt: any;
2709
+ } {
2710
+ const result: any = { ...node };
2711
+ return { ImportForeignSchemaStmt: result };
2712
+ }
2713
+ ClusterStmt(node: any, context: any): {
2714
+ ClusterStmt: any;
2715
+ } {
2716
+ const result: any = { ...node };
2717
+ return { ClusterStmt: result };
2718
+ }
2719
+ VacuumStmt(node: any, context: any): {
2720
+ VacuumStmt: any;
2721
+ } {
2722
+ const result: any = { ...node };
2723
+ return { VacuumStmt: result };
2724
+ }
2725
+ ExplainStmt(node: any, context: any): {
2726
+ ExplainStmt: any;
2727
+ } {
2728
+ const result: any = { ...node };
2729
+ return { ExplainStmt: result };
2730
+ }
2731
+ ReindexStmt(node: any, context: any): {
2732
+ ReindexStmt: any;
2733
+ } {
2734
+ const result: any = { ...node };
2735
+ return { ReindexStmt: result };
2736
+ }
2737
+ CallStmt(node: any, context: any): {
2738
+ CallStmt: any;
2739
+ } {
2740
+ const result: any = { ...node };
2741
+ return { CallStmt: result };
2742
+ }
2743
+ CreatedbStmt(node: any, context: any): {
2744
+ CreatedbStmt: any;
2745
+ } {
2746
+ const result: any = { ...node };
2747
+ return { CreatedbStmt: result };
2748
+ }
2749
+ DropdbStmt(node: any, context: any): {
2750
+ DropdbStmt: any;
2751
+ } {
2752
+ const result: any = { ...node };
2753
+ return { DropdbStmt: result };
2754
+ }
2755
+ RenameStmt(node: any, context: any): {
2756
+ RenameStmt: any;
2757
+ } {
2758
+ const result: any = { ...node };
2759
+ return { RenameStmt: result };
2760
+ }
2761
+ AlterOwnerStmt(node: any, context: any): {
2762
+ AlterOwnerStmt: any;
2763
+ } {
2764
+ const result: any = { ...node };
2765
+ return { AlterOwnerStmt: result };
2766
+ }
2767
+ GrantRoleStmt(node: any, context: any): {
2768
+ GrantRoleStmt: any;
2769
+ } {
2770
+ const result: any = {};
2771
+ if (node.granted_roles !== undefined) {
2772
+ result.granted_roles = Array.isArray(node.granted_roles)
2773
+ ? node.granted_roles.map((item: any) => this.transform(item as any, context))
2774
+ : this.transform(node.granted_roles as any, context);
2775
+ }
2776
+ if (node.grantee_roles !== undefined) {
2777
+ result.grantee_roles = Array.isArray(node.grantee_roles)
2778
+ ? node.grantee_roles.map((item: any) => this.transform(item as any, context))
2779
+ : this.transform(node.grantee_roles as any, context);
2780
+ }
2781
+ if (node.is_grant !== undefined) {
2782
+ result.is_grant = node.is_grant;
2783
+ }
2784
+ if (node.behavior !== undefined) {
2785
+ result.behavior = node.behavior;
2786
+ }
2787
+ const nodeAny = node as any;
2788
+ if (nodeAny.admin_opt === true) {
2789
+ result.opt = [
2790
+ {
2791
+ DefElem: {
2792
+ defname: "admin",
2793
+ arg: {
2794
+ Boolean: {
2795
+ boolval: true
2796
+ }
2797
+ },
2798
+ defaction: "DEFELEM_UNSPEC"
2799
+ }
2800
+ }
2801
+ ];
2802
+ }
2803
+ else if (nodeAny.opt !== undefined) {
2804
+ // Handle any existing opt field by transforming it
2805
+ result.opt = Array.isArray(nodeAny.opt)
2806
+ ? nodeAny.opt.map((item: any) => this.transform(item as any, context))
2807
+ : this.transform(nodeAny.opt as any, context);
2808
+ }
2809
+ return { GrantRoleStmt: result };
2810
+ }
2811
+ SecLabelStmt(node: any, context: any): {
2812
+ SecLabelStmt: any;
2813
+ } {
2814
+ const result: any = { ...node };
2815
+ return { SecLabelStmt: result };
2816
+ }
2817
+ AlterDefaultPrivilegesStmt(node: any, context: any): {
2818
+ AlterDefaultPrivilegesStmt: any;
2819
+ } {
2820
+ const result: any = { ...node };
2821
+ return { AlterDefaultPrivilegesStmt: result };
2822
+ }
2823
+ CreateConversionStmt(node: any, context: any): {
2824
+ CreateConversionStmt: any;
2825
+ } {
2826
+ const result: any = { ...node };
2827
+ return { CreateConversionStmt: result };
2828
+ }
2829
+ CreateCastStmt(node: any, context: any): {
2830
+ CreateCastStmt: any;
2831
+ } {
2832
+ const result: any = { ...node };
2833
+ return { CreateCastStmt: result };
2834
+ }
2835
+ CreatePLangStmt(node: any, context: any): {
2836
+ CreatePLangStmt: any;
2837
+ } {
2838
+ const result: any = { ...node };
2839
+ return { CreatePLangStmt: result };
2840
+ }
2841
+ CreateTransformStmt(node: any, context: any): {
2842
+ CreateTransformStmt: any;
2843
+ } {
2844
+ const result: any = { ...node };
2845
+ return { CreateTransformStmt: result };
2846
+ }
2847
+ CreateTrigStmt(node: any, context: any): {
2848
+ CreateTrigStmt: any;
2849
+ } {
2850
+ const result: any = { ...node };
2851
+ return { CreateTrigStmt: result };
2852
+ }
2853
+ TriggerTransition(node: any, context: any): {
2854
+ TriggerTransition: any;
2855
+ } {
2856
+ const result: any = { ...node };
2857
+ return { TriggerTransition: result };
2858
+ }
2859
+ CreateEventTrigStmt(node: any, context: any): {
2860
+ CreateEventTrigStmt: any;
2861
+ } {
2862
+ const result: any = { ...node };
2863
+ return { CreateEventTrigStmt: result };
2864
+ }
2865
+ AlterEventTrigStmt(node: any, context: any): {
2866
+ AlterEventTrigStmt: any;
2867
+ } {
2868
+ const result: any = { ...node };
2869
+ return { AlterEventTrigStmt: result };
2870
+ }
2871
+ CreateOpClassStmt(node: any, context: any): {
2872
+ CreateOpClassStmt: any;
2873
+ } {
2874
+ const result: any = { ...node };
2875
+ return { CreateOpClassStmt: result };
2876
+ }
2877
+ CreateOpFamilyStmt(node: any, context: any): {
2878
+ CreateOpFamilyStmt: any;
2879
+ } {
2880
+ const result: any = { ...node };
2881
+ return { CreateOpFamilyStmt: result };
2882
+ }
2883
+ AlterOpFamilyStmt(node: any, context: any): {
2884
+ AlterOpFamilyStmt: any;
2885
+ } {
2886
+ const result: any = { ...node };
2887
+ return { AlterOpFamilyStmt: result };
2888
+ }
2889
+ MergeStmt(node: any, context: any): {
2890
+ MergeStmt: any;
2891
+ } {
2892
+ const result: any = { ...node };
2893
+ return { MergeStmt: result };
2894
+ }
2895
+ AlterTableMoveAllStmt(node: any, context: any): {
2896
+ AlterTableMoveAllStmt: any;
2897
+ } {
2898
+ const result: any = { ...node };
2899
+ return { AlterTableMoveAllStmt: result };
2900
+ }
2901
+ CreateSeqStmt(node: any, context: any): {
2902
+ CreateSeqStmt: any;
2903
+ } {
2904
+ const result: any = { ...node };
2905
+ return { CreateSeqStmt: result };
2906
+ }
2907
+ AlterSeqStmt(node: any, context: any): {
2908
+ AlterSeqStmt: any;
2909
+ } {
2910
+ const result: any = { ...node };
2911
+ return { AlterSeqStmt: result };
2912
+ }
2913
+ CreateRangeStmt(node: any, context: any): {
2914
+ CreateRangeStmt: any;
2915
+ } {
2916
+ const result: any = {};
2917
+ if (node.typeName !== undefined) {
2918
+ result.typeName = Array.isArray(node.typeName)
2919
+ ? node.typeName.map((item: any) => this.transform(item as any, context))
2920
+ : this.transform(node.typeName as any, context);
2921
+ }
2922
+ if (node.params !== undefined) {
2923
+ result.params = Array.isArray(node.params)
2924
+ ? node.params.map((item: any) => this.transform(item as any, context))
2925
+ : this.transform(node.params as any, context);
2926
+ }
2927
+ return { CreateRangeStmt: result };
2928
+ }
2929
+ AlterEnumStmt(node: any, context: any): {
2930
+ AlterEnumStmt: any;
2931
+ } {
2932
+ const result: any = { ...node };
2933
+ return { AlterEnumStmt: result };
2934
+ }
2935
+ AlterTypeStmt(node: any, context: any): {
2936
+ AlterTypeStmt: any;
2937
+ } {
2938
+ const result: any = { ...node };
2939
+ return { AlterTypeStmt: result };
2940
+ }
2941
+ AlterRoleStmt(node: any, context: any): {
2942
+ AlterRoleStmt: any;
2943
+ } {
2944
+ const result: any = { ...node };
2945
+ return { AlterRoleStmt: result };
2946
+ }
2947
+ CreateTableAsStmt(node: any, context: any): {
2948
+ CreateTableAsStmt: any;
2949
+ } {
2950
+ const result: any = { ...node };
2951
+ return { CreateTableAsStmt: result };
2952
+ }
2953
+ RefreshMatViewStmt(node: any, context: any): {
2954
+ RefreshMatViewStmt: any;
2955
+ } {
2956
+ const result: any = { ...node };
2957
+ return { RefreshMatViewStmt: result };
2958
+ }
2959
+ AccessPriv(node: any, context: any): {
2960
+ AccessPriv: any;
2961
+ } {
2962
+ const result: any = { ...node };
2963
+ return { AccessPriv: result };
2964
+ }
2965
+ AlterDatabaseStmt(node: any, context: any): {
2966
+ AlterDatabaseStmt: any;
2967
+ } {
2968
+ const result: any = { ...node };
2969
+ return { AlterDatabaseStmt: result };
2970
+ }
2971
+ AlterDatabaseRefreshCollStmt(node: any, context: any): {
2972
+ AlterDatabaseRefreshCollStmt: any;
2973
+ } {
2974
+ const result: any = { ...node };
2975
+ return { AlterDatabaseRefreshCollStmt: result };
2976
+ }
2977
+ AlterDatabaseSetStmt(node: any, context: any): {
2978
+ AlterDatabaseSetStmt: any;
2979
+ } {
2980
+ const result: any = { ...node };
2981
+ return { AlterDatabaseSetStmt: result };
2982
+ }
2983
+ DeclareCursorStmt(node: any, context: any): {
2984
+ DeclareCursorStmt: any;
2985
+ } {
2986
+ const result: any = { ...node };
2987
+ return { DeclareCursorStmt: result };
2988
+ }
2989
+ PublicationObjSpec(node: any, context: any): {
2990
+ PublicationObjSpec: any;
2991
+ } {
2992
+ const result: any = { ...node };
2993
+ return { PublicationObjSpec: result };
2994
+ }
2995
+ PublicationTable(node: any, context: any): {
2996
+ PublicationTable: any;
2997
+ } {
2998
+ const result: any = { ...node };
2999
+ return { PublicationTable: result };
3000
+ }
3001
+ CreateAmStmt(node: any, context: any): {
3002
+ CreateAmStmt: any;
3003
+ } {
3004
+ const result: any = { ...node };
3005
+ return { CreateAmStmt: result };
3006
+ }
3007
+ IntoClause(node: any, context: any): {
3008
+ IntoClause: any;
3009
+ } {
3010
+ const result: any = { ...node };
3011
+ return { IntoClause: result };
3012
+ }
3013
+ OnConflictExpr(node: any, context: any): {
3014
+ OnConflictExpr: any;
3015
+ } {
3016
+ const result: any = { ...node };
3017
+ return { OnConflictExpr: result };
3018
+ }
3019
+ ScanToken(node: any, context: any): {
3020
+ ScanToken: any;
3021
+ } {
3022
+ const result: any = { ...node };
3023
+ return { ScanToken: result };
3024
+ }
3025
+ CreateOpClassItem(node: any, context: any): {
3026
+ CreateOpClassItem: any;
3027
+ } {
3028
+ const result: any = { ...node };
3029
+ return { CreateOpClassItem: result };
3030
+ }
3031
+ Var(node: any, context: any): {
3032
+ Var: any;
3033
+ } {
3034
+ const result: any = { ...node };
3035
+ return { Var: result };
3036
+ }
3037
+ TableFunc(node: any, context: any): {
3038
+ TableFunc: any;
3039
+ } {
3040
+ const result: any = { ...node };
3041
+ return { TableFunc: result };
3042
+ }
3043
+ RangeTableFunc(node: any, context: any): {
3044
+ RangeTableFunc: any;
3045
+ } {
3046
+ const result: any = { ...node };
3047
+ return { RangeTableFunc: result };
3048
+ }
3049
+ RangeTableFuncCol(node: any, context: any): {
3050
+ RangeTableFuncCol: any;
3051
+ } {
3052
+ const result: any = { ...node };
3053
+ return { RangeTableFuncCol: result };
3054
+ }
3055
+ RangeFunction(node: any, context: any): {
3056
+ RangeFunction: any;
3057
+ } {
3058
+ const result: any = { ...node };
3059
+ if (node.lateral !== undefined) {
3060
+ result.lateral = node.lateral;
3061
+ }
3062
+ if (node.ordinality !== undefined) {
3063
+ result.ordinality = node.ordinality;
3064
+ }
3065
+ if (node.is_rowsfrom !== undefined) {
3066
+ result.is_rowsfrom = node.is_rowsfrom;
3067
+ }
3068
+ if (node.functions !== undefined) {
3069
+ result.functions = Array.isArray(node.functions)
3070
+ ? node.functions.map((item: any) => this.transform(item as any, context))
3071
+ : this.transform(node.functions as any, context);
3072
+ }
3073
+ if (node.alias !== undefined) {
3074
+ result.alias = this.transform(node.alias as any, context);
3075
+ }
3076
+ if (node.coldeflist !== undefined) {
3077
+ result.coldeflist = Array.isArray(node.coldeflist)
3078
+ ? node.coldeflist.map((item: any) => this.transform(item as any, context))
3079
+ : this.transform(node.coldeflist as any, context);
3080
+ }
3081
+ return { RangeFunction: result };
3082
+ }
3083
+ RangeTableSample(node: any, context: any): {
3084
+ RangeTableSample: any;
3085
+ } {
3086
+ const result: any = { ...node };
3087
+ if (node.relation !== undefined) {
3088
+ result.relation = this.transform(node.relation as any, context);
3089
+ }
3090
+ if (node.method !== undefined) {
3091
+ result.method = Array.isArray(node.method)
3092
+ ? node.method.map((item: any) => this.transform(item as any, context))
3093
+ : this.transform(node.method as any, context);
3094
+ }
3095
+ if (node.args !== undefined) {
3096
+ result.args = Array.isArray(node.args)
3097
+ ? node.args.map((item: any) => this.transform(item as any, context))
3098
+ : this.transform(node.args as any, context);
3099
+ }
3100
+ if (node.repeatable !== undefined) {
3101
+ result.repeatable = this.transform(node.repeatable as any, context);
3102
+ }
3103
+ return { RangeTableSample: result };
3104
+ }
3105
+ XmlSerialize(node: any, context: any): {
3106
+ XmlSerialize: any;
3107
+ } {
3108
+ const result: any = { ...node };
3109
+ if (node.xmloption !== undefined) {
3110
+ result.xmloption = node.xmloption;
3111
+ }
3112
+ if (node.expr !== undefined) {
3113
+ result.expr = this.transform(node.expr as any, context);
3114
+ }
3115
+ if (node.typeName !== undefined) {
3116
+ result.typeName = this.transform(node.typeName as any, context);
3117
+ }
3118
+ if (node.location !== undefined) {
3119
+ result.location = node.location;
3120
+ }
3121
+ return { XmlSerialize: result };
3122
+ }
3123
+ RuleStmt(node: any, context: any): {
3124
+ RuleStmt: any;
3125
+ } {
3126
+ const result: any = { ...node };
3127
+ return { RuleStmt: result };
3128
+ }
3129
+ SQLValueFunction(node: any, context: any): {
3130
+ SQLValueFunction: any;
3131
+ } {
3132
+ const result: any = { ...node };
3133
+ return { SQLValueFunction: result };
3134
+ }
3135
+ GroupingFunc(node: any, context: any): {
3136
+ GroupingFunc: any;
3137
+ } {
3138
+ const result: any = { ...node };
3139
+ return { GroupingFunc: result };
3140
+ }
3141
+ MultiAssignRef(node: any, context: any): {
3142
+ MultiAssignRef: any;
3143
+ } {
3144
+ const result: any = { ...node };
3145
+ return { MultiAssignRef: result };
3146
+ }
3147
+ SetToDefault(node: any, context: any): {
3148
+ SetToDefault: any;
3149
+ } {
3150
+ const result: any = { ...node };
3151
+ return { SetToDefault: result };
3152
+ }
3153
+ CurrentOfExpr(node: any, context: any): {
3154
+ CurrentOfExpr: any;
3155
+ } {
3156
+ const result: any = { ...node };
3157
+ return { CurrentOfExpr: result };
3158
+ }
3159
+ TableLikeClause(node: any, context: any): {
3160
+ TableLikeClause: any;
3161
+ } {
3162
+ const result: any = { ...node };
3163
+ return { TableLikeClause: result };
3164
+ }
3165
+ AlterFunctionStmt(node: any, context: any): {
3166
+ AlterFunctionStmt: any;
3167
+ } {
3168
+ const result: any = { ...node };
3169
+ return { AlterFunctionStmt: result };
3170
+ }
3171
+ AlterObjectSchemaStmt(node: any, context: any): {
3172
+ AlterObjectSchemaStmt: any;
3173
+ } {
3174
+ const result: any = { ...node };
3175
+ return { AlterObjectSchemaStmt: result };
3176
+ }
3177
+ CreateForeignTableStmt(node: any, context: any): {
3178
+ CreateForeignTableStmt: any;
3179
+ } {
3180
+ const result: any = { ...node };
3181
+ return { CreateForeignTableStmt: result };
3182
+ }
3183
+ DropRoleStmt(node: any, context: any): {
3184
+ DropRoleStmt: any;
3185
+ } {
3186
+ const result: any = { ...node };
3187
+ if (node.missing_ok !== undefined) {
3188
+ result.missing_ok = node.missing_ok;
3189
+ }
3190
+ if (node.roles !== undefined) {
3191
+ result.roles = Array.isArray(node.roles)
3192
+ ? node.roles.map((item: any) => this.transform(item as any, context))
3193
+ : this.transform(node.roles as any, context);
3194
+ }
3195
+ return { DropRoleStmt: result };
3196
+ }
3197
+ XmlExpr(node: any, context: any): {
3198
+ XmlExpr: any;
3199
+ } {
3200
+ const result: any = { ...node };
3201
+ if (node.xpr !== undefined) {
3202
+ result.xpr = this.transform(node.xpr as any, context);
3203
+ }
3204
+ if (node.op !== undefined) {
3205
+ result.op = node.op;
3206
+ }
3207
+ if (node.name !== undefined) {
3208
+ result.name = node.name;
3209
+ }
3210
+ if (node.named_args !== undefined) {
3211
+ result.named_args = Array.isArray(node.named_args)
3212
+ ? node.named_args.map((item: any) => this.transform(item as any, context))
3213
+ : this.transform(node.named_args as any, context);
3214
+ }
3215
+ if (node.arg_names !== undefined) {
3216
+ result.arg_names = Array.isArray(node.arg_names)
3217
+ ? node.arg_names.map((item: any) => this.transform(item as any, context))
3218
+ : this.transform(node.arg_names as any, context);
3219
+ }
3220
+ if (node.args !== undefined) {
3221
+ result.args = Array.isArray(node.args)
3222
+ ? node.args.map((item: any) => this.transform(item as any, context))
3223
+ : this.transform(node.args as any, context);
3224
+ }
3225
+ if (node.xmloption !== undefined) {
3226
+ result.xmloption = node.xmloption;
3227
+ }
3228
+ if (node.type !== undefined) {
3229
+ result.type = node.type;
3230
+ }
3231
+ if (node.typmod !== undefined) {
3232
+ result.typmod = node.typmod;
3233
+ }
3234
+ if (node.location !== undefined) {
3235
+ result.location = node.location;
3236
+ }
3237
+ return { XmlExpr: result };
3238
+ }
3239
+ AlterRoleSetStmt(node: any, context: any): {
3240
+ AlterRoleSetStmt: any;
3241
+ } {
3242
+ const result: any = { ...node };
3243
+ if (node.role !== undefined) {
3244
+ result.role = this.transform(node.role as any, context);
3245
+ }
3246
+ if (node.database !== undefined) {
3247
+ result.database = node.database;
3248
+ }
3249
+ if (node.setstmt !== undefined) {
3250
+ result.setstmt = this.transform(node.setstmt as any, context);
3251
+ }
3252
+ return { AlterRoleSetStmt: result };
3253
+ }
3254
+ GrantStmt(node: any, context: any): {
3255
+ GrantStmt: any;
3256
+ } {
3257
+ const result: any = { ...node };
3258
+ if (node.is_grant !== undefined) {
3259
+ result.is_grant = node.is_grant;
3260
+ }
3261
+ if (node.targtype !== undefined) {
3262
+ result.targtype = node.targtype;
3263
+ }
3264
+ if (node.objtype !== undefined) {
3265
+ result.objtype = node.objtype;
3266
+ }
3267
+ if (node.objects !== undefined) {
3268
+ result.objects = Array.isArray(node.objects)
3269
+ ? node.objects.map((item: any) => this.transform(item as any, context))
3270
+ : this.transform(node.objects as any, context);
3271
+ }
3272
+ if (node.privileges !== undefined) {
3273
+ result.privileges = Array.isArray(node.privileges)
3274
+ ? node.privileges.map((item: any) => this.transform(item as any, context))
3275
+ : this.transform(node.privileges as any, context);
3276
+ }
3277
+ if (node.grantees !== undefined) {
3278
+ result.grantees = Array.isArray(node.grantees)
3279
+ ? node.grantees.map((item: any) => this.transform(item as any, context))
3280
+ : this.transform(node.grantees as any, context);
3281
+ }
3282
+ if (node.grant_option !== undefined) {
3283
+ result.grant_option = node.grant_option;
3284
+ }
3285
+ if (node.behavior !== undefined) {
3286
+ result.behavior = node.behavior;
3287
+ }
3288
+ return { GrantStmt: result };
3289
+ }
3290
+ }