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