pgsql-deparser 13.15.0 → 13.18.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.
@@ -0,0 +1,1624 @@
1
+ /**
2
+ * Auto-generated file with types stripped for better tree-shaking
3
+ * DO NOT EDIT - Generated by strip-transformer-types.ts
4
+ */
5
+
6
+ // @ts-nocheck
7
+ /**
8
+ * V14 to V15 AST Transformer
9
+ * Transforms PostgreSQL v14 AST nodes to v15 format
10
+ */
11
+ export class V14ToV15Transformer {
12
+ transform(node: any, context: any = { parentNodeTypes: [] }): any {
13
+ if (node == null) {
14
+ return null;
15
+ }
16
+ if (typeof node === 'number' || node instanceof Number) {
17
+ return node;
18
+ }
19
+ if (typeof node === 'string') {
20
+ return node;
21
+ }
22
+ try {
23
+ return this.visit(node, context);
24
+ }
25
+ catch (error) {
26
+ const nodeType = Object.keys(node)[0];
27
+ throw new Error(`Error transforming ${nodeType}: ${(error as Error).message}`);
28
+ }
29
+ }
30
+ visit(node: any, context: any = { parentNodeTypes: [] }): any {
31
+ const nodeType = this.getNodeType(node);
32
+ // Handle empty objects
33
+ if (!nodeType) {
34
+ return {};
35
+ }
36
+ const nodeData = this.getNodeData(node);
37
+ const methodName = nodeType as keyof this;
38
+ if (typeof this[methodName] === 'function') {
39
+ const childContext: any = {
40
+ ...context,
41
+ parentNodeTypes: [...context.parentNodeTypes, nodeType]
42
+ };
43
+ const result = (this[methodName] as any)(nodeData, childContext);
44
+ return result;
45
+ }
46
+ // If no specific method, use transformGenericNode to handle nested transformations
47
+ return this.transformGenericNode(node, context);
48
+ }
49
+ getNodeType(node: any): any {
50
+ return Object.keys(node)[0];
51
+ }
52
+ getNodeData(node: any): any {
53
+ const keys = Object.keys(node);
54
+ if (keys.length === 1 && typeof (node as any)[keys[0]] === 'object') {
55
+ return (node as any)[keys[0]];
56
+ }
57
+ return node;
58
+ }
59
+ private transformGenericNode(node: any, context: any): any {
60
+ if (typeof node !== 'object' || node === null)
61
+ return node;
62
+ if (Array.isArray(node))
63
+ return node.map(item => this.transform(item, context));
64
+ const keys = Object.keys(node);
65
+ if (keys.length === 1 && typeof node[keys[0]] === 'object' && node[keys[0]] !== null && !Array.isArray(node[keys[0]])) {
66
+ const nodeType = keys[0];
67
+ const nodeData = node[keys[0]];
68
+ const transformedData: any = {};
69
+ for (const [key, value] of Object.entries(nodeData)) {
70
+ if (Array.isArray(value)) {
71
+ if (key === 'arrayBounds') {
72
+ transformedData[key] = value.map(item => {
73
+ return this.transform(item as any, context);
74
+ });
75
+ }
76
+ else {
77
+ transformedData[key] = value.map(item => this.transform(item as any, context));
78
+ }
79
+ }
80
+ else if (typeof value === 'object' && value !== null) {
81
+ const keys = Object.keys(value);
82
+ const isNumericKeysObject = keys.every(k => /^\d+$/.test(k));
83
+ if (isNumericKeysObject && keys.length > 0) {
84
+ const sortedKeys = keys.sort((a, b) => parseInt(a) - parseInt(b));
85
+ transformedData[key] = sortedKeys.map(k => this.transform((value as any)[k], context));
86
+ }
87
+ else {
88
+ // Regular object transformation
89
+ transformedData[key] = this.transform(value as any, context);
90
+ }
91
+ }
92
+ else {
93
+ transformedData[key] = value;
94
+ }
95
+ }
96
+ return { [nodeType]: transformedData };
97
+ }
98
+ const result: any = {};
99
+ for (const [key, value] of Object.entries(node)) {
100
+ if (Array.isArray(value)) {
101
+ if (key === 'arrayBounds') {
102
+ result[key] = value.map(item => {
103
+ return this.transform(item as any, context);
104
+ });
105
+ }
106
+ else {
107
+ result[key] = value.map(item => this.transform(item as any, context));
108
+ }
109
+ }
110
+ else if (typeof value === 'object' && value !== null) {
111
+ const keys = Object.keys(value);
112
+ const isNumericKeysObject = keys.every(k => /^\d+$/.test(k));
113
+ if (isNumericKeysObject && keys.length > 0) {
114
+ const sortedKeys = keys.sort((a, b) => parseInt(a) - parseInt(b));
115
+ result[key] = sortedKeys.map(k => this.transform((value as any)[k], context));
116
+ }
117
+ else {
118
+ // Regular object transformation
119
+ result[key] = this.transform(value as any, context);
120
+ }
121
+ }
122
+ else {
123
+ result[key] = value;
124
+ }
125
+ }
126
+ return result;
127
+ }
128
+ ParseResult(node: any, context: any): any {
129
+ if (node && typeof node === 'object' && 'version' in node && 'stmts' in node) {
130
+ return {
131
+ version: 150000, // PG15 version
132
+ stmts: node.stmts.map((stmt: any) => {
133
+ if (stmt && typeof stmt === 'object' && 'stmt' in stmt) {
134
+ return {
135
+ ...stmt,
136
+ stmt: this.transform(stmt.stmt, context)
137
+ };
138
+ }
139
+ return this.transform(stmt, context);
140
+ })
141
+ };
142
+ }
143
+ return node as any;
144
+ }
145
+ RawStmt(node: any, context: any): {
146
+ RawStmt: any;
147
+ } {
148
+ const result = this.transformGenericNode(node, context);
149
+ return { RawStmt: result };
150
+ }
151
+ SelectStmt(node: any, context: any): {
152
+ SelectStmt: any;
153
+ } {
154
+ const result = this.transformGenericNode(node, context);
155
+ return { SelectStmt: result };
156
+ }
157
+ A_Expr(node: any, context: any): {
158
+ A_Expr: any;
159
+ } {
160
+ const result = this.transformGenericNode(node, context);
161
+ return { A_Expr: result };
162
+ }
163
+ InsertStmt(node: any, context: any): {
164
+ InsertStmt: any;
165
+ } {
166
+ const result = this.transformGenericNode(node, context);
167
+ return { InsertStmt: result };
168
+ }
169
+ UpdateStmt(node: any, context: any): {
170
+ UpdateStmt: any;
171
+ } {
172
+ const result = this.transformGenericNode(node, context);
173
+ return { UpdateStmt: result };
174
+ }
175
+ DeleteStmt(node: any, context: any): {
176
+ DeleteStmt: any;
177
+ } {
178
+ const result = this.transformGenericNode(node, context);
179
+ return { DeleteStmt: result };
180
+ }
181
+ WithClause(node: any, context: any): {
182
+ WithClause: any;
183
+ } {
184
+ const result = this.transformGenericNode(node, context);
185
+ return { WithClause: result };
186
+ }
187
+ ResTarget(node: any, context: any): {
188
+ ResTarget: any;
189
+ } {
190
+ const result = this.transformGenericNode(node, context);
191
+ return { ResTarget: result };
192
+ }
193
+ BoolExpr(node: any, context: any): {
194
+ BoolExpr: any;
195
+ } {
196
+ const result = this.transformGenericNode(node, context);
197
+ return { BoolExpr: result };
198
+ }
199
+ FuncCall(node: any, context: any): {
200
+ FuncCall: any;
201
+ } {
202
+ const result = this.transformGenericNode(node, context);
203
+ return { FuncCall: result };
204
+ }
205
+ FuncExpr(node: any, context: any): {
206
+ FuncExpr: any;
207
+ } {
208
+ const result = this.transformGenericNode(node, context);
209
+ return { FuncExpr: result };
210
+ }
211
+ A_Const(node: any, context: any): {
212
+ A_Const: any;
213
+ } {
214
+ const result: any = {};
215
+ for (const [key, value] of Object.entries(node)) {
216
+ result[key] = value;
217
+ }
218
+ if (result.val) {
219
+ const val: any = result.val;
220
+ if (val.String && val.String.str !== undefined) {
221
+ result.sval = { sval: val.String.str };
222
+ delete result.val;
223
+ }
224
+ else if (val.Integer !== undefined) {
225
+ if (val.Integer.ival !== undefined) {
226
+ if (val.Integer.ival === 0) {
227
+ result.ival = {};
228
+ }
229
+ else {
230
+ result.ival = { ival: val.Integer.ival };
231
+ }
232
+ }
233
+ else {
234
+ result.ival = {};
235
+ }
236
+ delete result.val;
237
+ }
238
+ else if (val.Float && val.Float.str !== undefined) {
239
+ result.fval = { fval: val.Float.str };
240
+ delete result.val;
241
+ }
242
+ else if (val.BitString && val.BitString.str !== undefined) {
243
+ result.bsval = { bsval: val.BitString.str };
244
+ delete result.val;
245
+ }
246
+ else if (val.Null !== undefined) {
247
+ result.isnull = true;
248
+ delete result.val;
249
+ }
250
+ }
251
+ // Handle ival field directly (not nested in val) - removed overly broad conversion
252
+ return { A_Const: result };
253
+ }
254
+ ColumnRef(node: any, context: any): {
255
+ ColumnRef: any;
256
+ } {
257
+ const result = this.transformGenericNode(node, context);
258
+ return { ColumnRef: result };
259
+ }
260
+ TypeName(node: any, context: any): {
261
+ TypeName: any;
262
+ } {
263
+ const result = this.transformGenericNode(node, context);
264
+ return { TypeName: result };
265
+ }
266
+ Alias(node: any, context: any): {
267
+ Alias: any;
268
+ } {
269
+ const result = this.transformGenericNode(node, context);
270
+ return { Alias: result };
271
+ }
272
+ RangeVar(node: any, context: any): {
273
+ RangeVar: any;
274
+ } {
275
+ const result = this.transformGenericNode(node, context);
276
+ return { RangeVar: result };
277
+ }
278
+ A_ArrayExpr(node: any, context: any): {
279
+ A_ArrayExpr: any;
280
+ } {
281
+ const result = this.transformGenericNode(node, context);
282
+ return { A_ArrayExpr: result };
283
+ }
284
+ A_Indices(node: any, context: any): {
285
+ A_Indices: any;
286
+ } {
287
+ const result: any = {};
288
+ if (node.is_slice !== undefined) {
289
+ result.is_slice = node.is_slice;
290
+ }
291
+ if (node.lidx !== undefined) {
292
+ result.lidx = this.transform(node.lidx as any, context);
293
+ }
294
+ if (node.uidx !== undefined) {
295
+ const childContext = {
296
+ ...context,
297
+ parentNodeTypes: [...(context.parentNodeTypes || []), 'A_Indices']
298
+ };
299
+ result.uidx = this.transform(node.uidx as any, childContext);
300
+ }
301
+ return { A_Indices: result };
302
+ }
303
+ A_Indirection(node: any, context: any): {
304
+ A_Indirection: any;
305
+ } {
306
+ const result = this.transformGenericNode(node, context);
307
+ return { A_Indirection: result };
308
+ }
309
+ A_Star(node: any, context: any): {
310
+ A_Star: any;
311
+ } {
312
+ const result = this.transformGenericNode(node, context);
313
+ return { A_Star: result };
314
+ }
315
+ CaseExpr(node: any, context: any): {
316
+ CaseExpr: any;
317
+ } {
318
+ const result = this.transformGenericNode(node, context);
319
+ return { CaseExpr: result };
320
+ }
321
+ CoalesceExpr(node: any, context: any): {
322
+ CoalesceExpr: any;
323
+ } {
324
+ const result = this.transformGenericNode(node, context);
325
+ return { CoalesceExpr: result };
326
+ }
327
+ TypeCast(node: any, context: any): {
328
+ TypeCast: any;
329
+ } | {
330
+ A_Const: any;
331
+ } {
332
+ if (node.location === -1 && node.typeName && node.typeName.names) {
333
+ const typeNames = node.typeName.names.map(name => {
334
+ if (name && typeof name === 'object' && 'String' in name) {
335
+ const stringVal = name.String;
336
+ return (stringVal as any).sval || (stringVal as any).str;
337
+ }
338
+ return null;
339
+ }).filter(Boolean);
340
+ const hasPgCatalog = typeNames.includes('pg_catalog');
341
+ const hasBool = typeNames.includes('bool');
342
+ if (hasPgCatalog && hasBool && node.arg) {
343
+ const arg = node.arg as any;
344
+ if (arg.A_Const) {
345
+ let stringValue = null;
346
+ // Handle both sval and val.String formats
347
+ if (arg.A_Const.sval && arg.A_Const.sval.sval) {
348
+ stringValue = arg.A_Const.sval.sval;
349
+ }
350
+ else if (arg.A_Const.val && arg.A_Const.val.String) {
351
+ if (arg.A_Const.val.String.sval) {
352
+ stringValue = arg.A_Const.val.String.sval;
353
+ }
354
+ else if (arg.A_Const.val.String.str) {
355
+ stringValue = arg.A_Const.val.String.str;
356
+ }
357
+ }
358
+ if (stringValue === 't' || stringValue === 'true') {
359
+ return {
360
+ A_Const: {
361
+ boolval: { boolval: true },
362
+ location: arg.A_Const.location
363
+ }
364
+ };
365
+ }
366
+ else if (stringValue === 'f' || stringValue === 'false') {
367
+ return {
368
+ A_Const: {
369
+ boolval: {},
370
+ location: arg.A_Const.location
371
+ }
372
+ };
373
+ }
374
+ }
375
+ }
376
+ }
377
+ const result = this.transformGenericNode(node, context);
378
+ return { TypeCast: result };
379
+ }
380
+ CollateClause(node: any, context: any): {
381
+ CollateClause: any;
382
+ } {
383
+ const result = this.transformGenericNode(node, context);
384
+ return { CollateClause: result };
385
+ }
386
+ BooleanTest(node: any, context: any): {
387
+ BooleanTest: any;
388
+ } {
389
+ const result = this.transformGenericNode(node, context);
390
+ return { BooleanTest: result };
391
+ }
392
+ NullTest(node: any, context: any): {
393
+ NullTest: any;
394
+ } {
395
+ const result = this.transformGenericNode(node, context);
396
+ return { NullTest: result };
397
+ }
398
+ String(node: any, context: any): {
399
+ String: any;
400
+ } {
401
+ const result: any = { ...node };
402
+ if (result.str !== undefined) {
403
+ result.sval = result.str;
404
+ delete result.str;
405
+ }
406
+ return { String: result };
407
+ }
408
+ Integer(node: any, context: any): {
409
+ Integer: any;
410
+ } | {
411
+ Boolean: any;
412
+ } {
413
+ const isInDefElemContext = context.parentNodeTypes?.includes('DefElem');
414
+ if (isInDefElemContext && node.ival !== undefined) {
415
+ const defElemName = (context as any).defElemName;
416
+ // CreateRoleStmt: specific role attributes should become Boolean
417
+ if (defElemName && ['createrole', 'superuser', 'canlogin', 'createdb', 'inherit', 'bypassrls', 'isreplication'].includes(defElemName) &&
418
+ (node.ival === 0 || node.ival === 1)) {
419
+ return {
420
+ Boolean: {
421
+ boolval: node.ival === 1
422
+ }
423
+ };
424
+ }
425
+ // CreateExtensionStmt: cascade should become Boolean
426
+ if (context.parentNodeTypes?.includes('CreateExtensionStmt') && defElemName) {
427
+ if (defElemName === 'cascade' && (node.ival === 0 || node.ival === 1)) {
428
+ return {
429
+ Boolean: {
430
+ boolval: node.ival === 1
431
+ }
432
+ };
433
+ }
434
+ }
435
+ // CreateFunctionStmt: window should become Boolean
436
+ if (context.parentNodeTypes?.includes('CreateFunctionStmt') && defElemName) {
437
+ if (defElemName === 'window' && (node.ival === 0 || node.ival === 1)) {
438
+ return {
439
+ Boolean: {
440
+ boolval: node.ival === 1
441
+ }
442
+ };
443
+ }
444
+ }
445
+ if (['strict', 'security', 'leakproof', 'cycle'].includes(defElemName) && (node.ival === 0 || node.ival === 1)) {
446
+ return {
447
+ Boolean: {
448
+ boolval: node.ival === 1
449
+ }
450
+ };
451
+ }
452
+ }
453
+ // AlterTableCmd context: SET STATISTICS with ival 0 or -1 -> empty Integer
454
+ if (context.parentNodeTypes?.includes('AlterTableCmd') && !context.parentNodeTypes?.includes('DefineStmt') && (node.ival === 0)) {
455
+ return { Integer: {} };
456
+ }
457
+ // DefineStmt context: specific cases where ival should become empty Integer
458
+ if (context.parentNodeTypes?.includes('DefineStmt')) {
459
+ const defElemName = (context as any).defElemName;
460
+ if (defElemName === 'initcond' && (node.ival === 0)) {
461
+ return { Integer: {} };
462
+ }
463
+ if (defElemName === 'sspace' && node.ival === 0) {
464
+ return { Integer: {} };
465
+ }
466
+ // DefineStmt args context: ival 0 should become empty Integer for aggregates
467
+ if (!defElemName && (node.ival === 0)) {
468
+ return { Integer: {} };
469
+ }
470
+ }
471
+ // CreateSeqStmt context: specific cases where ival should become empty Integer
472
+ if (context.parentNodeTypes?.includes('CreateSeqStmt')) {
473
+ const defElemName = (context as any).defElemName;
474
+ if (defElemName === 'start' && node.ival === 0) {
475
+ return { Integer: {} };
476
+ }
477
+ if (defElemName === 'minvalue' && node.ival === 0) {
478
+ return { Integer: {} };
479
+ }
480
+ if (defElemName === 'increment' && node.ival === 0) {
481
+ return { Integer: {} };
482
+ }
483
+ }
484
+ const result: any = { ...node };
485
+ return { Integer: result };
486
+ }
487
+ Float(node: any, context: any): {
488
+ Float: any;
489
+ } {
490
+ const result: any = { ...node };
491
+ if (result.str !== undefined) {
492
+ result.fval = result.str;
493
+ delete result.str;
494
+ }
495
+ return { Float: result };
496
+ }
497
+ BitString(node: any, context: any): {
498
+ BitString: any;
499
+ } {
500
+ const result: any = { ...node };
501
+ if (result.str !== undefined) {
502
+ result.bsval = result.str;
503
+ delete result.str;
504
+ }
505
+ return { BitString: result };
506
+ }
507
+ // NOTE: there is no Null type in PG15
508
+ Null(node: any, context: any): any {
509
+ const result = this.transformGenericNode(node, context);
510
+ return { Null: result };
511
+ }
512
+ List(node: any, context: any): {
513
+ List: any;
514
+ } {
515
+ const result = this.transformGenericNode(node, context);
516
+ return { List: result };
517
+ }
518
+ CreateStmt(node: any, context: any): {
519
+ CreateStmt: any;
520
+ } {
521
+ const result = this.transformGenericNode(node, context);
522
+ return { CreateStmt: result };
523
+ }
524
+ ColumnDef(node: any, context: any): {
525
+ ColumnDef: any;
526
+ } {
527
+ const result = this.transformGenericNode(node, context);
528
+ return { ColumnDef: result };
529
+ }
530
+ Constraint(node: any, context: any): {
531
+ Constraint: any;
532
+ } {
533
+ const result = this.transformGenericNode(node, context);
534
+ return { Constraint: result };
535
+ }
536
+ SubLink(node: any, context: any): {
537
+ SubLink: any;
538
+ } {
539
+ const result = this.transformGenericNode(node, context);
540
+ return { SubLink: result };
541
+ }
542
+ CaseWhen(node: any, context: any): {
543
+ CaseWhen: any;
544
+ } {
545
+ const result = this.transformGenericNode(node, context);
546
+ return { CaseWhen: result };
547
+ }
548
+ WindowDef(node: any, context: any): {
549
+ WindowDef: any;
550
+ } {
551
+ const result = this.transformGenericNode(node, context);
552
+ return { WindowDef: result };
553
+ }
554
+ SortBy(node: any, context: any): {
555
+ SortBy: any;
556
+ } {
557
+ const result = this.transformGenericNode(node, context);
558
+ return { SortBy: result };
559
+ }
560
+ GroupingSet(node: any, context: any): {
561
+ GroupingSet: any;
562
+ } {
563
+ const result = this.transformGenericNode(node, context);
564
+ return { GroupingSet: result };
565
+ }
566
+ CommonTableExpr(node: any, context: any): {
567
+ CommonTableExpr: any;
568
+ } {
569
+ const result = this.transformGenericNode(node, context);
570
+ return { CommonTableExpr: result };
571
+ }
572
+ ParamRef(node: any, context: any): {
573
+ ParamRef: any;
574
+ } {
575
+ const result = this.transformGenericNode(node, context);
576
+ return { ParamRef: result };
577
+ }
578
+ LockingClause(node: any, context: any): {
579
+ LockingClause: any;
580
+ } {
581
+ const result = this.transformGenericNode(node, context);
582
+ return { LockingClause: result };
583
+ }
584
+ MinMaxExpr(node: any, context: any): {
585
+ MinMaxExpr: any;
586
+ } {
587
+ const result = this.transformGenericNode(node, context);
588
+ return { MinMaxExpr: result };
589
+ }
590
+ RowExpr(node: any, context: any): {
591
+ RowExpr: any;
592
+ } {
593
+ const result = this.transformGenericNode(node, context);
594
+ return { RowExpr: result };
595
+ }
596
+ OpExpr(node: any, context: any): {
597
+ OpExpr: any;
598
+ } {
599
+ const result = this.transformGenericNode(node, context);
600
+ return { OpExpr: result };
601
+ }
602
+ DistinctExpr(node: any, context: any): {
603
+ DistinctExpr: any;
604
+ } {
605
+ const result = this.transformGenericNode(node, context);
606
+ return { DistinctExpr: result };
607
+ }
608
+ NullIfExpr(node: any, context: any): {
609
+ NullIfExpr: any;
610
+ } {
611
+ const result = this.transformGenericNode(node, context);
612
+ return { NullIfExpr: result };
613
+ }
614
+ ScalarArrayOpExpr(node: any, context: any): {
615
+ ScalarArrayOpExpr: any;
616
+ } {
617
+ const result = this.transformGenericNode(node, context);
618
+ return { ScalarArrayOpExpr: result };
619
+ }
620
+ Aggref(node: any, context: any): {
621
+ Aggref: any;
622
+ } {
623
+ const result = this.transformGenericNode(node, context);
624
+ return { Aggref: result };
625
+ }
626
+ WindowFunc(node: any, context: any): {
627
+ WindowFunc: any;
628
+ } {
629
+ const result = this.transformGenericNode(node, context);
630
+ return { WindowFunc: result };
631
+ }
632
+ FieldSelect(node: any, context: any): {
633
+ FieldSelect: any;
634
+ } {
635
+ const result = this.transformGenericNode(node, context);
636
+ return { FieldSelect: result };
637
+ }
638
+ RelabelType(node: any, context: any): {
639
+ RelabelType: any;
640
+ } {
641
+ const result = this.transformGenericNode(node, context);
642
+ return { RelabelType: result };
643
+ }
644
+ CoerceViaIO(node: any, context: any): {
645
+ CoerceViaIO: any;
646
+ } {
647
+ const result = this.transformGenericNode(node, context);
648
+ return { CoerceViaIO: result };
649
+ }
650
+ ArrayCoerceExpr(node: any, context: any): {
651
+ ArrayCoerceExpr: any;
652
+ } {
653
+ const result = this.transformGenericNode(node, context);
654
+ return { ArrayCoerceExpr: result };
655
+ }
656
+ ConvertRowtypeExpr(node: any, context: any): {
657
+ ConvertRowtypeExpr: any;
658
+ } {
659
+ const result = this.transformGenericNode(node, context);
660
+ return { ConvertRowtypeExpr: result };
661
+ }
662
+ NamedArgExpr(node: any, context: any): {
663
+ NamedArgExpr: any;
664
+ } {
665
+ const result = this.transformGenericNode(node, context);
666
+ return { NamedArgExpr: result };
667
+ }
668
+ ViewStmt(node: any, context: any): {
669
+ ViewStmt: any;
670
+ } {
671
+ const result = this.transformGenericNode(node, context);
672
+ return { ViewStmt: result };
673
+ }
674
+ IndexStmt(node: any, context: any): {
675
+ IndexStmt: any;
676
+ } {
677
+ const result = this.transformGenericNode(node, context);
678
+ return { IndexStmt: result };
679
+ }
680
+ IndexElem(node: any, context: any): {
681
+ IndexElem: any;
682
+ } {
683
+ const result = this.transformGenericNode(node, context);
684
+ return { IndexElem: result };
685
+ }
686
+ PartitionElem(node: any, context: any): {
687
+ PartitionElem: any;
688
+ } {
689
+ const result = this.transformGenericNode(node, context);
690
+ return { PartitionElem: result };
691
+ }
692
+ PartitionCmd(node: any, context: any): {
693
+ PartitionCmd: any;
694
+ } {
695
+ const result = this.transformGenericNode(node, context);
696
+ return { PartitionCmd: result };
697
+ }
698
+ JoinExpr(node: any, context: any): {
699
+ JoinExpr: any;
700
+ } {
701
+ const result = this.transformGenericNode(node, context);
702
+ return { JoinExpr: result };
703
+ }
704
+ FromExpr(node: any, context: any): {
705
+ FromExpr: any;
706
+ } {
707
+ const result = this.transformGenericNode(node, context);
708
+ return { FromExpr: result };
709
+ }
710
+ TransactionStmt(node: any, context: any): {
711
+ TransactionStmt: any;
712
+ } {
713
+ const result = this.transformGenericNode(node, context);
714
+ return { TransactionStmt: result };
715
+ }
716
+ VariableSetStmt(node: any, context: any): {
717
+ VariableSetStmt: any;
718
+ } {
719
+ const result = this.transformGenericNode(node, context);
720
+ return { VariableSetStmt: result };
721
+ }
722
+ VariableShowStmt(node: any, context: any): {
723
+ VariableShowStmt: any;
724
+ } {
725
+ const result = this.transformGenericNode(node, context);
726
+ return { VariableShowStmt: result };
727
+ }
728
+ CreateSchemaStmt(node: any, context: any): {
729
+ CreateSchemaStmt: any;
730
+ } {
731
+ const result = this.transformGenericNode(node, context);
732
+ return { CreateSchemaStmt: result };
733
+ }
734
+ RoleSpec(node: any, context: any): {
735
+ RoleSpec: any;
736
+ } {
737
+ const result = this.transformGenericNode(node, context);
738
+ return { RoleSpec: result };
739
+ }
740
+ DropStmt(node: any, context: any): {
741
+ DropStmt: any;
742
+ } {
743
+ const result = this.transformGenericNode(node, context);
744
+ return { DropStmt: result };
745
+ }
746
+ TruncateStmt(node: any, context: any): {
747
+ TruncateStmt: any;
748
+ } {
749
+ const result = this.transformGenericNode(node, context);
750
+ return { TruncateStmt: result };
751
+ }
752
+ ReturnStmt(node: any, context: any): {
753
+ ReturnStmt: any;
754
+ } {
755
+ const result: any = {};
756
+ if (node.returnval !== undefined) {
757
+ result.returnval = this.transform(node.returnval as any, context);
758
+ }
759
+ return { ReturnStmt: result };
760
+ }
761
+ PLAssignStmt(node: any, context: any): {
762
+ PLAssignStmt: any;
763
+ } {
764
+ const result = this.transformGenericNode(node, context);
765
+ return { PLAssignStmt: result };
766
+ }
767
+ CopyStmt(node: any, context: any): {
768
+ CopyStmt: any;
769
+ } {
770
+ const result: any = {};
771
+ if (node.relation !== undefined) {
772
+ result.relation = this.transform(node.relation as any, context);
773
+ }
774
+ if (node.query !== undefined) {
775
+ result.query = this.transform(node.query as any, context);
776
+ }
777
+ if (node.attlist !== undefined) {
778
+ result.attlist = Array.isArray(node.attlist)
779
+ ? node.attlist.map(item => this.transform(item as any, context))
780
+ : this.transform(node.attlist as any, context);
781
+ }
782
+ if (node.is_from !== undefined) {
783
+ result.is_from = node.is_from;
784
+ }
785
+ if (node.is_program !== undefined) {
786
+ result.is_program = node.is_program;
787
+ }
788
+ if (node.filename !== undefined) {
789
+ result.filename = node.filename;
790
+ }
791
+ if (node.options !== undefined) {
792
+ result.options = Array.isArray(node.options)
793
+ ? node.options.map(item => this.transform(item as any, context))
794
+ : this.transform(node.options as any, context);
795
+ }
796
+ if (node.whereClause !== undefined) {
797
+ result.whereClause = this.transform(node.whereClause as any, context);
798
+ }
799
+ return { CopyStmt: result };
800
+ }
801
+ AlterTableStmt(node: any, context: any): {
802
+ AlterTableStmt: any;
803
+ } {
804
+ const result = this.transformGenericNode(node, context);
805
+ return { AlterTableStmt: result };
806
+ }
807
+ AlterTableCmd(node: any, context: any): {
808
+ AlterTableCmd: any;
809
+ } {
810
+ const result: any = {};
811
+ if (node.subtype !== undefined) {
812
+ result.subtype = node.subtype;
813
+ }
814
+ if (node.name !== undefined) {
815
+ result.name = node.name;
816
+ }
817
+ if (node.num !== undefined) {
818
+ result.num = node.num;
819
+ }
820
+ if (node.newowner !== undefined) {
821
+ result.newowner = this.transform(node.newowner as any, context);
822
+ }
823
+ if (node.def !== undefined) {
824
+ result.def = this.transform(node.def as any, context);
825
+ }
826
+ if (node.behavior !== undefined) {
827
+ result.behavior = node.behavior;
828
+ }
829
+ if (node.missing_ok !== undefined) {
830
+ result.missing_ok = node.missing_ok;
831
+ }
832
+ return { AlterTableCmd: result };
833
+ }
834
+ CreateFunctionStmt(node: any, context: any): {
835
+ CreateFunctionStmt: any;
836
+ } {
837
+ const result = this.transformGenericNode(node, context);
838
+ return { CreateFunctionStmt: result };
839
+ }
840
+ FunctionParameter(node: any, context: any): {
841
+ FunctionParameter: any;
842
+ } {
843
+ const result = this.transformGenericNode(node, context);
844
+ return { FunctionParameter: result };
845
+ }
846
+ CompositeTypeStmt(node: any, context: any): {
847
+ CompositeTypeStmt: any;
848
+ } {
849
+ const result = this.transformGenericNode(node, context);
850
+ return { CompositeTypeStmt: result };
851
+ }
852
+ CreateEnumStmt(node: any, context: any): {
853
+ CreateEnumStmt: any;
854
+ } {
855
+ const result = this.transformGenericNode(node, context);
856
+ return { CreateEnumStmt: result };
857
+ }
858
+ CreateDomainStmt(node: any, context: any): {
859
+ CreateDomainStmt: any;
860
+ } {
861
+ const result = this.transformGenericNode(node, context);
862
+ return { CreateDomainStmt: result };
863
+ }
864
+ CreateRoleStmt(node: any, context: any): {
865
+ CreateRoleStmt: any;
866
+ } {
867
+ const result = this.transformGenericNode(node, context);
868
+ return { CreateRoleStmt: result };
869
+ }
870
+ DefElem(node: any, context: any): {
871
+ DefElem: any;
872
+ } {
873
+ const result: any = {};
874
+ if (node.defnamespace !== undefined) {
875
+ result.defnamespace = node.defnamespace;
876
+ }
877
+ if (node.defname !== undefined) {
878
+ result.defname = node.defname;
879
+ }
880
+ if (node.arg !== undefined) {
881
+ const argContext = {
882
+ ...context,
883
+ defElemName: node.defname,
884
+ parentNodeTypes: [...(context.parentNodeTypes || []), 'DefElem']
885
+ };
886
+ result.arg = this.transform(node.arg as any, argContext);
887
+ }
888
+ if (node.defaction !== undefined) {
889
+ result.defaction = node.defaction;
890
+ }
891
+ if (node.location !== undefined) {
892
+ result.location = node.location;
893
+ }
894
+ return { DefElem: result };
895
+ }
896
+ CreateTableSpaceStmt(node: any, context: any): {
897
+ CreateTableSpaceStmt: any;
898
+ } {
899
+ const result = this.transformGenericNode(node, context);
900
+ return { CreateTableSpaceStmt: result };
901
+ }
902
+ DropTableSpaceStmt(node: any, context: any): {
903
+ DropTableSpaceStmt: any;
904
+ } {
905
+ const result = this.transformGenericNode(node, context);
906
+ return { DropTableSpaceStmt: result };
907
+ }
908
+ AlterTableSpaceOptionsStmt(node: any, context: any): {
909
+ AlterTableSpaceOptionsStmt: any;
910
+ } {
911
+ const result = this.transformGenericNode(node, context);
912
+ return { AlterTableSpaceOptionsStmt: result };
913
+ }
914
+ CreateExtensionStmt(node: any, context: any): {
915
+ CreateExtensionStmt: any;
916
+ } {
917
+ const result = this.transformGenericNode(node, context);
918
+ return { CreateExtensionStmt: result };
919
+ }
920
+ AlterExtensionStmt(node: any, context: any): {
921
+ AlterExtensionStmt: any;
922
+ } {
923
+ const result = this.transformGenericNode(node, context);
924
+ return { AlterExtensionStmt: result };
925
+ }
926
+ CreateFdwStmt(node: any, context: any): {
927
+ CreateFdwStmt: any;
928
+ } {
929
+ const result = this.transformGenericNode(node, context);
930
+ return { CreateFdwStmt: result };
931
+ }
932
+ SetOperationStmt(node: any, context: any): {
933
+ SetOperationStmt: any;
934
+ } {
935
+ const result = this.transformGenericNode(node, context);
936
+ return { SetOperationStmt: result };
937
+ }
938
+ ReplicaIdentityStmt(node: any, context: any): {
939
+ ReplicaIdentityStmt: any;
940
+ } {
941
+ const result = this.transformGenericNode(node, context);
942
+ return { ReplicaIdentityStmt: result };
943
+ }
944
+ AlterCollationStmt(node: any, context: any): {
945
+ AlterCollationStmt: any;
946
+ } {
947
+ const result = this.transformGenericNode(node, context);
948
+ return { AlterCollationStmt: result };
949
+ }
950
+ AlterDomainStmt(node: any, context: any): {
951
+ AlterDomainStmt: any;
952
+ } {
953
+ const result = this.transformGenericNode(node, context);
954
+ return { AlterDomainStmt: result };
955
+ }
956
+ PrepareStmt(node: any, context: any): {
957
+ PrepareStmt: any;
958
+ } {
959
+ const result = this.transformGenericNode(node, context);
960
+ return { PrepareStmt: result };
961
+ }
962
+ ExecuteStmt(node: any, context: any): {
963
+ ExecuteStmt: any;
964
+ } {
965
+ const result = this.transformGenericNode(node, context);
966
+ return { ExecuteStmt: result };
967
+ }
968
+ DeallocateStmt(node: any, context: any): {
969
+ DeallocateStmt: any;
970
+ } {
971
+ const result = this.transformGenericNode(node, context);
972
+ return { DeallocateStmt: result };
973
+ }
974
+ NotifyStmt(node: any, context: any): {
975
+ NotifyStmt: any;
976
+ } {
977
+ const result = this.transformGenericNode(node, context);
978
+ return { NotifyStmt: result };
979
+ }
980
+ ListenStmt(node: any, context: any): {
981
+ ListenStmt: any;
982
+ } {
983
+ const result = this.transformGenericNode(node, context);
984
+ return { ListenStmt: result };
985
+ }
986
+ UnlistenStmt(node: any, context: any): {
987
+ UnlistenStmt: any;
988
+ } {
989
+ const result = this.transformGenericNode(node, context);
990
+ return { UnlistenStmt: result };
991
+ }
992
+ CheckPointStmt(node: any, context: any): {
993
+ CheckPointStmt: any;
994
+ } {
995
+ const result = this.transformGenericNode(node, context);
996
+ return { CheckPointStmt: result };
997
+ }
998
+ LoadStmt(node: any, context: any): {
999
+ LoadStmt: any;
1000
+ } {
1001
+ const result = this.transformGenericNode(node, context);
1002
+ return { LoadStmt: result };
1003
+ }
1004
+ DiscardStmt(node: any, context: any): {
1005
+ DiscardStmt: any;
1006
+ } {
1007
+ const result = this.transformGenericNode(node, context);
1008
+ return { DiscardStmt: result };
1009
+ }
1010
+ CommentStmt(node: any, context: any): {
1011
+ CommentStmt: any;
1012
+ } {
1013
+ const result = this.transformGenericNode(node, context);
1014
+ return { CommentStmt: result };
1015
+ }
1016
+ LockStmt(node: any, context: any): {
1017
+ LockStmt: any;
1018
+ } {
1019
+ const result = this.transformGenericNode(node, context);
1020
+ return { LockStmt: result };
1021
+ }
1022
+ CreatePolicyStmt(node: any, context: any): {
1023
+ CreatePolicyStmt: any;
1024
+ } {
1025
+ const result = this.transformGenericNode(node, context);
1026
+ return { CreatePolicyStmt: result };
1027
+ }
1028
+ AlterPolicyStmt(node: any, context: any): {
1029
+ AlterPolicyStmt: any;
1030
+ } {
1031
+ const result = this.transformGenericNode(node, context);
1032
+ return { AlterPolicyStmt: result };
1033
+ }
1034
+ CreateUserMappingStmt(node: any, context: any): {
1035
+ CreateUserMappingStmt: any;
1036
+ } {
1037
+ const result = this.transformGenericNode(node, context);
1038
+ return { CreateUserMappingStmt: result };
1039
+ }
1040
+ CreateStatsStmt(node: any, context: any): {
1041
+ CreateStatsStmt: any;
1042
+ } {
1043
+ const result = this.transformGenericNode(node, context);
1044
+ return { CreateStatsStmt: result };
1045
+ }
1046
+ StatsElem(node: any, context: any): {
1047
+ StatsElem: any;
1048
+ } {
1049
+ const result = this.transformGenericNode(node, context);
1050
+ return { StatsElem: result };
1051
+ }
1052
+ CreatePublicationStmt(node: any, context: any): {
1053
+ CreatePublicationStmt: any;
1054
+ } {
1055
+ const result = this.transformGenericNode(node, context);
1056
+ return { CreatePublicationStmt: result };
1057
+ }
1058
+ CreateSubscriptionStmt(node: any, context: any): {
1059
+ CreateSubscriptionStmt: any;
1060
+ } {
1061
+ const result = this.transformGenericNode(node, context);
1062
+ return { CreateSubscriptionStmt: result };
1063
+ }
1064
+ AlterPublicationStmt(node: any, context: any): {
1065
+ AlterPublicationStmt: any;
1066
+ } {
1067
+ const result = this.transformGenericNode(node, context);
1068
+ return { AlterPublicationStmt: result };
1069
+ }
1070
+ AlterSubscriptionStmt(node: any, context: any): {
1071
+ AlterSubscriptionStmt: any;
1072
+ } {
1073
+ const result = this.transformGenericNode(node, context);
1074
+ return { AlterSubscriptionStmt: result };
1075
+ }
1076
+ DropSubscriptionStmt(node: any, context: any): {
1077
+ DropSubscriptionStmt: any;
1078
+ } {
1079
+ const result = this.transformGenericNode(node, context);
1080
+ return { DropSubscriptionStmt: result };
1081
+ }
1082
+ DoStmt(node: any, context: any): {
1083
+ DoStmt: any;
1084
+ } {
1085
+ const result = this.transformGenericNode(node, context);
1086
+ return { DoStmt: result };
1087
+ }
1088
+ InlineCodeBlock(node: any, context: any): {
1089
+ InlineCodeBlock: any;
1090
+ } {
1091
+ const result = this.transformGenericNode(node, context);
1092
+ return { InlineCodeBlock: result };
1093
+ }
1094
+ CallContext(node: any, context: any): {
1095
+ CallContext: any;
1096
+ } {
1097
+ const result = this.transformGenericNode(node, context);
1098
+ return { CallContext: result };
1099
+ }
1100
+ ConstraintsSetStmt(node: any, context: any): {
1101
+ ConstraintsSetStmt: any;
1102
+ } {
1103
+ const result = this.transformGenericNode(node, context);
1104
+ return { ConstraintsSetStmt: result };
1105
+ }
1106
+ AlterSystemStmt(node: any, context: any): {
1107
+ AlterSystemStmt: any;
1108
+ } {
1109
+ const result = this.transformGenericNode(node, context);
1110
+ return { AlterSystemStmt: result };
1111
+ }
1112
+ VacuumRelation(node: any, context: any): {
1113
+ VacuumRelation: any;
1114
+ } {
1115
+ const result = this.transformGenericNode(node, context);
1116
+ return { VacuumRelation: result };
1117
+ }
1118
+ DropOwnedStmt(node: any, context: any): {
1119
+ DropOwnedStmt: any;
1120
+ } {
1121
+ const result = this.transformGenericNode(node, context);
1122
+ return { DropOwnedStmt: result };
1123
+ }
1124
+ ReassignOwnedStmt(node: any, context: any): {
1125
+ ReassignOwnedStmt: any;
1126
+ } {
1127
+ const result = this.transformGenericNode(node, context);
1128
+ return { ReassignOwnedStmt: result };
1129
+ }
1130
+ AlterTSDictionaryStmt(node: any, context: any): {
1131
+ AlterTSDictionaryStmt: any;
1132
+ } {
1133
+ const result = this.transformGenericNode(node, context);
1134
+ return { AlterTSDictionaryStmt: result };
1135
+ }
1136
+ AlterTSConfigurationStmt(node: any, context: any): {
1137
+ AlterTSConfigurationStmt: any;
1138
+ } {
1139
+ const result = this.transformGenericNode(node, context);
1140
+ return { AlterTSConfigurationStmt: result };
1141
+ }
1142
+ ClosePortalStmt(node: any, context: any): {
1143
+ ClosePortalStmt: any;
1144
+ } {
1145
+ const result = this.transformGenericNode(node, context);
1146
+ return { ClosePortalStmt: result };
1147
+ }
1148
+ FetchStmt(node: any, context: any): {
1149
+ FetchStmt: any;
1150
+ } {
1151
+ const result = this.transformGenericNode(node, context);
1152
+ return { FetchStmt: result };
1153
+ }
1154
+ AlterStatsStmt(node: any, context: any): {
1155
+ AlterStatsStmt: any;
1156
+ } {
1157
+ const result = this.transformGenericNode(node, context);
1158
+ return { AlterStatsStmt: result };
1159
+ }
1160
+ ObjectWithArgs(node: any, context: any): {
1161
+ ObjectWithArgs: any;
1162
+ } {
1163
+ const result = this.transformGenericNode(node, context);
1164
+ return { ObjectWithArgs: result };
1165
+ }
1166
+ AlterOperatorStmt(node: any, context: any): {
1167
+ AlterOperatorStmt: any;
1168
+ } {
1169
+ const result = this.transformGenericNode(node, context);
1170
+ return { AlterOperatorStmt: result };
1171
+ }
1172
+ AlterFdwStmt(node: any, context: any): {
1173
+ AlterFdwStmt: any;
1174
+ } {
1175
+ const result = this.transformGenericNode(node, context);
1176
+ return { AlterFdwStmt: result };
1177
+ }
1178
+ CreateForeignServerStmt(node: any, context: any): {
1179
+ CreateForeignServerStmt: any;
1180
+ } {
1181
+ const result = this.transformGenericNode(node, context);
1182
+ return { CreateForeignServerStmt: result };
1183
+ }
1184
+ AlterForeignServerStmt(node: any, context: any): {
1185
+ AlterForeignServerStmt: any;
1186
+ } {
1187
+ const result = this.transformGenericNode(node, context);
1188
+ return { AlterForeignServerStmt: result };
1189
+ }
1190
+ AlterUserMappingStmt(node: any, context: any): {
1191
+ AlterUserMappingStmt: any;
1192
+ } {
1193
+ const result = this.transformGenericNode(node, context);
1194
+ return { AlterUserMappingStmt: result };
1195
+ }
1196
+ DropUserMappingStmt(node: any, context: any): {
1197
+ DropUserMappingStmt: any;
1198
+ } {
1199
+ const result = this.transformGenericNode(node, context);
1200
+ return { DropUserMappingStmt: result };
1201
+ }
1202
+ ImportForeignSchemaStmt(node: any, context: any): {
1203
+ ImportForeignSchemaStmt: any;
1204
+ } {
1205
+ const result = this.transformGenericNode(node, context);
1206
+ return { ImportForeignSchemaStmt: result };
1207
+ }
1208
+ ClusterStmt(node: any, context: any): {
1209
+ ClusterStmt: any;
1210
+ } {
1211
+ const result = this.transformGenericNode(node, context);
1212
+ return { ClusterStmt: result };
1213
+ }
1214
+ VacuumStmt(node: any, context: any): {
1215
+ VacuumStmt: any;
1216
+ } {
1217
+ const result = this.transformGenericNode(node, context);
1218
+ return { VacuumStmt: result };
1219
+ }
1220
+ ExplainStmt(node: any, context: any): {
1221
+ ExplainStmt: any;
1222
+ } {
1223
+ const result = this.transformGenericNode(node, context);
1224
+ return { ExplainStmt: result };
1225
+ }
1226
+ ReindexStmt(node: any, context: any): {
1227
+ ReindexStmt: any;
1228
+ } {
1229
+ const result = this.transformGenericNode(node, context);
1230
+ return { ReindexStmt: result };
1231
+ }
1232
+ CallStmt(node: any, context: any): {
1233
+ CallStmt: any;
1234
+ } {
1235
+ const result = this.transformGenericNode(node, context);
1236
+ return { CallStmt: result };
1237
+ }
1238
+ CreatedbStmt(node: any, context: any): {
1239
+ CreatedbStmt: any;
1240
+ } {
1241
+ const result = this.transformGenericNode(node, context);
1242
+ return { CreatedbStmt: result };
1243
+ }
1244
+ DropdbStmt(node: any, context: any): {
1245
+ DropdbStmt: any;
1246
+ } {
1247
+ const result = this.transformGenericNode(node, context);
1248
+ return { DropdbStmt: result };
1249
+ }
1250
+ RenameStmt(node: any, context: any): {
1251
+ RenameStmt: any;
1252
+ } {
1253
+ const result = this.transformGenericNode(node, context);
1254
+ return { RenameStmt: result };
1255
+ }
1256
+ AlterOwnerStmt(node: any, context: any): {
1257
+ AlterOwnerStmt: any;
1258
+ } {
1259
+ const result = this.transformGenericNode(node, context);
1260
+ return { AlterOwnerStmt: result };
1261
+ }
1262
+ GrantStmt(node: any, context: any): {
1263
+ GrantStmt: any;
1264
+ } {
1265
+ const result = this.transformGenericNode(node, context);
1266
+ return { GrantStmt: result };
1267
+ }
1268
+ GrantRoleStmt(node: any, context: any): {
1269
+ GrantRoleStmt: any;
1270
+ } {
1271
+ const result = this.transformGenericNode(node, context);
1272
+ return { GrantRoleStmt: result };
1273
+ }
1274
+ SecLabelStmt(node: any, context: any): {
1275
+ SecLabelStmt: any;
1276
+ } {
1277
+ const result = this.transformGenericNode(node, context);
1278
+ return { SecLabelStmt: result };
1279
+ }
1280
+ AlterDefaultPrivilegesStmt(node: any, context: any): {
1281
+ AlterDefaultPrivilegesStmt: any;
1282
+ } {
1283
+ const result = this.transformGenericNode(node, context);
1284
+ return { AlterDefaultPrivilegesStmt: result };
1285
+ }
1286
+ CreateConversionStmt(node: any, context: any): {
1287
+ CreateConversionStmt: any;
1288
+ } {
1289
+ const result = this.transformGenericNode(node, context);
1290
+ return { CreateConversionStmt: result };
1291
+ }
1292
+ CreateCastStmt(node: any, context: any): {
1293
+ CreateCastStmt: any;
1294
+ } {
1295
+ const result = this.transformGenericNode(node, context);
1296
+ return { CreateCastStmt: result };
1297
+ }
1298
+ CreatePLangStmt(node: any, context: any): {
1299
+ CreatePLangStmt: any;
1300
+ } {
1301
+ const result = this.transformGenericNode(node, context);
1302
+ return { CreatePLangStmt: result };
1303
+ }
1304
+ CreateTransformStmt(node: any, context: any): {
1305
+ CreateTransformStmt: any;
1306
+ } {
1307
+ const result = this.transformGenericNode(node, context);
1308
+ return { CreateTransformStmt: result };
1309
+ }
1310
+ CreateTrigStmt(node: any, context: any): {
1311
+ CreateTrigStmt: any;
1312
+ } {
1313
+ const result = this.transformGenericNode(node, context);
1314
+ return { CreateTrigStmt: result };
1315
+ }
1316
+ TriggerTransition(node: any, context: any): {
1317
+ TriggerTransition: any;
1318
+ } {
1319
+ const result = this.transformGenericNode(node, context);
1320
+ return { TriggerTransition: result };
1321
+ }
1322
+ CreateEventTrigStmt(node: any, context: any): {
1323
+ CreateEventTrigStmt: any;
1324
+ } {
1325
+ const result = this.transformGenericNode(node, context);
1326
+ return { CreateEventTrigStmt: result };
1327
+ }
1328
+ AlterEventTrigStmt(node: any, context: any): {
1329
+ AlterEventTrigStmt: any;
1330
+ } {
1331
+ const result = this.transformGenericNode(node, context);
1332
+ return { AlterEventTrigStmt: result };
1333
+ }
1334
+ CreateOpClassStmt(node: any, context: any): {
1335
+ CreateOpClassStmt: any;
1336
+ } {
1337
+ const result = this.transformGenericNode(node, context);
1338
+ return { CreateOpClassStmt: result };
1339
+ }
1340
+ CreateOpFamilyStmt(node: any, context: any): {
1341
+ CreateOpFamilyStmt: any;
1342
+ } {
1343
+ const result = this.transformGenericNode(node, context);
1344
+ return { CreateOpFamilyStmt: result };
1345
+ }
1346
+ AlterOpFamilyStmt(node: any, context: any): {
1347
+ AlterOpFamilyStmt: any;
1348
+ } {
1349
+ const result = this.transformGenericNode(node, context);
1350
+ return { AlterOpFamilyStmt: result };
1351
+ }
1352
+ AlterTableMoveAllStmt(node: any, context: any): {
1353
+ AlterTableMoveAllStmt: any;
1354
+ } {
1355
+ const result = this.transformGenericNode(node, context);
1356
+ return { AlterTableMoveAllStmt: result };
1357
+ }
1358
+ CreateSeqStmt(node: any, context: any): {
1359
+ CreateSeqStmt: any;
1360
+ } {
1361
+ const result = this.transformGenericNode(node, context);
1362
+ return { CreateSeqStmt: result };
1363
+ }
1364
+ AlterSeqStmt(node: any, context: any): {
1365
+ AlterSeqStmt: any;
1366
+ } {
1367
+ const result = this.transformGenericNode(node, context);
1368
+ return { AlterSeqStmt: result };
1369
+ }
1370
+ CreateRangeStmt(node: any, context: any): {
1371
+ CreateRangeStmt: any;
1372
+ } {
1373
+ const result = this.transformGenericNode(node, context);
1374
+ return { CreateRangeStmt: result };
1375
+ }
1376
+ AlterEnumStmt(node: any, context: any): {
1377
+ AlterEnumStmt: any;
1378
+ } {
1379
+ const result = this.transformGenericNode(node, context);
1380
+ return { AlterEnumStmt: result };
1381
+ }
1382
+ AlterTypeStmt(node: any, context: any): {
1383
+ AlterTypeStmt: any;
1384
+ } {
1385
+ const result = this.transformGenericNode(node, context);
1386
+ return { AlterTypeStmt: result };
1387
+ }
1388
+ AlterRoleStmt(node: any, context: any): {
1389
+ AlterRoleStmt: any;
1390
+ } {
1391
+ const result = this.transformGenericNode(node, context);
1392
+ return { AlterRoleStmt: result };
1393
+ }
1394
+ DropRoleStmt(node: any, context: any): {
1395
+ DropRoleStmt: any;
1396
+ } {
1397
+ const result = this.transformGenericNode(node, context);
1398
+ return { DropRoleStmt: result };
1399
+ }
1400
+ CreateTableAsStmt(node: any, context: any): {
1401
+ CreateTableAsStmt: any;
1402
+ } {
1403
+ const result = this.transformGenericNode(node, context);
1404
+ return { CreateTableAsStmt: result };
1405
+ }
1406
+ RefreshMatViewStmt(node: any, context: any): {
1407
+ RefreshMatViewStmt: any;
1408
+ } {
1409
+ const result = this.transformGenericNode(node, context);
1410
+ return { RefreshMatViewStmt: result };
1411
+ }
1412
+ AccessPriv(node: any, context: any): {
1413
+ AccessPriv: any;
1414
+ } {
1415
+ const result = this.transformGenericNode(node, context);
1416
+ return { AccessPriv: result };
1417
+ }
1418
+ DefineStmt(node: any, context: any): {
1419
+ DefineStmt: any;
1420
+ } {
1421
+ const result: any = {};
1422
+ if (node.kind !== undefined) {
1423
+ result.kind = node.kind;
1424
+ }
1425
+ if (node.oldstyle !== undefined) {
1426
+ result.oldstyle = node.oldstyle;
1427
+ }
1428
+ if (node.defnames !== undefined) {
1429
+ result.defnames = Array.isArray(node.defnames)
1430
+ ? node.defnames.map(item => this.transform(item as any, context))
1431
+ : this.transform(node.defnames as any, context);
1432
+ }
1433
+ if (node.args !== undefined) {
1434
+ result.args = Array.isArray(node.args)
1435
+ ? node.args.map(item => this.transform(item as any, context))
1436
+ : this.transform(node.args as any, context);
1437
+ }
1438
+ if (node.definition !== undefined) {
1439
+ result.definition = Array.isArray(node.definition)
1440
+ ? node.definition.map(item => this.transform(item as any, context))
1441
+ : this.transform(node.definition as any, context);
1442
+ }
1443
+ if (node.if_not_exists !== undefined) {
1444
+ result.if_not_exists = node.if_not_exists;
1445
+ }
1446
+ if (node.replace !== undefined) {
1447
+ result.replace = node.replace;
1448
+ }
1449
+ return { DefineStmt: result };
1450
+ }
1451
+ AlterDatabaseStmt(node: any, context: any): {
1452
+ AlterDatabaseStmt: any;
1453
+ } {
1454
+ const result = this.transformGenericNode(node, context);
1455
+ return { AlterDatabaseStmt: result };
1456
+ }
1457
+ AlterDatabaseSetStmt(node: any, context: any): {
1458
+ AlterDatabaseSetStmt: any;
1459
+ } {
1460
+ const result = this.transformGenericNode(node, context);
1461
+ return { AlterDatabaseSetStmt: result };
1462
+ }
1463
+ DeclareCursorStmt(node: any, context: any): {
1464
+ DeclareCursorStmt: any;
1465
+ } {
1466
+ const result = this.transformGenericNode(node, context);
1467
+ return { DeclareCursorStmt: result };
1468
+ }
1469
+ CreateAmStmt(node: any, context: any): {
1470
+ CreateAmStmt: any;
1471
+ } {
1472
+ const result = this.transformGenericNode(node, context);
1473
+ return { CreateAmStmt: result };
1474
+ }
1475
+ IntoClause(node: any, context: any): {
1476
+ IntoClause: any;
1477
+ } {
1478
+ const result = this.transformGenericNode(node, context);
1479
+ return { IntoClause: result };
1480
+ }
1481
+ OnConflictExpr(node: any, context: any): {
1482
+ OnConflictExpr: any;
1483
+ } {
1484
+ const result = this.transformGenericNode(node, context);
1485
+ return { OnConflictExpr: result };
1486
+ }
1487
+ ScanToken(node: any, context: any): {
1488
+ ScanToken: any;
1489
+ } {
1490
+ const result = this.transformGenericNode(node, context);
1491
+ return { ScanToken: result };
1492
+ }
1493
+ CreateOpClassItem(node: any, context: any): {
1494
+ CreateOpClassItem: any;
1495
+ } {
1496
+ const result = this.transformGenericNode(node, context);
1497
+ return { CreateOpClassItem: result };
1498
+ }
1499
+ Var(node: any, context: any): {
1500
+ Var: any;
1501
+ } {
1502
+ const result = this.transformGenericNode(node, context);
1503
+ return { Var: result };
1504
+ }
1505
+ TableFunc(node: any, context: any): {
1506
+ TableFunc: any;
1507
+ } {
1508
+ const result = this.transformGenericNode(node, context);
1509
+ return { TableFunc: result };
1510
+ }
1511
+ RangeTableFunc(node: any, context: any): {
1512
+ RangeTableFunc: any;
1513
+ } {
1514
+ const result = this.transformGenericNode(node, context);
1515
+ return { RangeTableFunc: result };
1516
+ }
1517
+ RangeTableFuncCol(node: any, context: any): {
1518
+ RangeTableFuncCol: any;
1519
+ } {
1520
+ const result = this.transformGenericNode(node, context);
1521
+ return { RangeTableFuncCol: result };
1522
+ }
1523
+ RangeFunction(node: any, context: any): {
1524
+ RangeFunction: any;
1525
+ } {
1526
+ const result = this.transformGenericNode(node, context);
1527
+ return { RangeFunction: result };
1528
+ }
1529
+ XmlExpr(node: any, context: any): {
1530
+ XmlExpr: any;
1531
+ } {
1532
+ const result = this.transformGenericNode(node, context);
1533
+ return { XmlExpr: result };
1534
+ }
1535
+ RangeTableSample(node: any, context: any): {
1536
+ RangeTableSample: any;
1537
+ } {
1538
+ const result = this.transformGenericNode(node, context);
1539
+ return { RangeTableSample: result };
1540
+ }
1541
+ XmlSerialize(node: any, context: any): {
1542
+ XmlSerialize: any;
1543
+ } {
1544
+ const result = this.transformGenericNode(node, context);
1545
+ return { XmlSerialize: result };
1546
+ }
1547
+ RuleStmt(node: any, context: any): {
1548
+ RuleStmt: any;
1549
+ } {
1550
+ const result = this.transformGenericNode(node, context);
1551
+ return { RuleStmt: result };
1552
+ }
1553
+ RangeSubselect(node: any, context: any): {
1554
+ RangeSubselect: any;
1555
+ } {
1556
+ const result = this.transformGenericNode(node, context);
1557
+ return { RangeSubselect: result };
1558
+ }
1559
+ SQLValueFunction(node: any, context: any): {
1560
+ SQLValueFunction: any;
1561
+ } {
1562
+ const result = this.transformGenericNode(node, context);
1563
+ return { SQLValueFunction: result };
1564
+ }
1565
+ GroupingFunc(node: any, context: any): {
1566
+ GroupingFunc: any;
1567
+ } {
1568
+ const result = this.transformGenericNode(node, context);
1569
+ return { GroupingFunc: result };
1570
+ }
1571
+ MultiAssignRef(node: any, context: any): {
1572
+ MultiAssignRef: any;
1573
+ } {
1574
+ const result = this.transformGenericNode(node, context);
1575
+ return { MultiAssignRef: result };
1576
+ }
1577
+ SetToDefault(node: any, context: any): {
1578
+ SetToDefault: any;
1579
+ } {
1580
+ const result = this.transformGenericNode(node, context);
1581
+ return { SetToDefault: result };
1582
+ }
1583
+ CurrentOfExpr(node: any, context: any): {
1584
+ CurrentOfExpr: any;
1585
+ } {
1586
+ const result = this.transformGenericNode(node, context);
1587
+ return { CurrentOfExpr: result };
1588
+ }
1589
+ TableLikeClause(node: any, context: any): {
1590
+ TableLikeClause: any;
1591
+ } {
1592
+ const result = this.transformGenericNode(node, context);
1593
+ return { TableLikeClause: result };
1594
+ }
1595
+ AlterFunctionStmt(node: any, context: any): {
1596
+ AlterFunctionStmt: any;
1597
+ } {
1598
+ const result = this.transformGenericNode(node, context);
1599
+ return { AlterFunctionStmt: result };
1600
+ }
1601
+ AlterObjectSchemaStmt(node: any, context: any): {
1602
+ AlterObjectSchemaStmt: any;
1603
+ } {
1604
+ const result = this.transformGenericNode(node, context);
1605
+ return { AlterObjectSchemaStmt: result };
1606
+ }
1607
+ AlterRoleSetStmt(node: any, context: any): {
1608
+ AlterRoleSetStmt: any;
1609
+ } {
1610
+ const result = this.transformGenericNode(node, context);
1611
+ return { AlterRoleSetStmt: result };
1612
+ }
1613
+ CreateForeignTableStmt(node: any, context: any): {
1614
+ CreateForeignTableStmt: any;
1615
+ } {
1616
+ const result = this.transformGenericNode(node, context);
1617
+ return { CreateForeignTableStmt: result };
1618
+ }
1619
+ // NOTE: this doesn't exist in v14?
1620
+ CreateAccessMethodStmt(node: any, context: any): any {
1621
+ const result = this.transformGenericNode(node, context);
1622
+ return { CreateAccessMethodStmt: result };
1623
+ }
1624
+ }