pgsql-deparser 14.0.0 → 14.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 (54) hide show
  1. package/README.md +12 -6
  2. package/{dist/deparser → deparser}/deparser.d.ts +4 -3
  3. package/{dist/deparser → deparser}/deparser.js +883 -437
  4. package/{dist/deparser → deparser}/utils/sql-formatter.js +1 -1
  5. package/deparser/visitors/base.d.ts +68 -0
  6. package/deparser/visitors/base.js +122 -0
  7. package/{dist/esm → esm}/deparser/deparser.js +883 -437
  8. package/{dist/esm → esm}/deparser/utils/sql-formatter.js +1 -1
  9. package/esm/deparser/visitors/base.js +117 -0
  10. package/{dist/esm → esm}/v14-to-v15.js +3 -0
  11. package/{dist/esm → esm}/v15-to-v16.js +60 -1
  12. package/package.json +1 -2
  13. package/{dist/v14-to-v15.js → v14-to-v15.js} +3 -0
  14. package/{dist/v15-to-v16.d.ts → v15-to-v16.d.ts} +6 -0
  15. package/{dist/v15-to-v16.js → v15-to-v16.js} +60 -1
  16. package/dist/README.md +0 -160
  17. package/dist/deparser/visitors/base.d.ts +0 -21
  18. package/dist/deparser/visitors/base.js +0 -34
  19. package/dist/esm/deparser/visitors/base.js +0 -30
  20. package/dist/package.json +0 -42
  21. package/src/deparser/deparser.ts +0 -10026
  22. package/src/deparser/index.ts +0 -14
  23. package/src/deparser/utils/list-utils.ts +0 -27
  24. package/src/deparser/utils/quote-utils.ts +0 -86
  25. package/src/deparser/utils/sql-formatter.ts +0 -37
  26. package/src/deparser/visitors/base.ts +0 -40
  27. package/src/index.ts +0 -27
  28. package/src/v14-to-v15.ts +0 -1621
  29. package/src/v14-to-v17-direct.ts +0 -68
  30. package/src/v15-to-v16.ts +0 -3290
  31. package/src/v16-to-v17.ts +0 -1897
  32. package/tsconfig.esm.json +0 -8
  33. package/tsconfig.json +0 -26
  34. /package/{dist/LICENSE → LICENSE} +0 -0
  35. /package/{dist/deparser → deparser}/index.d.ts +0 -0
  36. /package/{dist/deparser → deparser}/index.js +0 -0
  37. /package/{dist/deparser → deparser}/utils/list-utils.d.ts +0 -0
  38. /package/{dist/deparser → deparser}/utils/list-utils.js +0 -0
  39. /package/{dist/deparser → deparser}/utils/quote-utils.d.ts +0 -0
  40. /package/{dist/deparser → deparser}/utils/quote-utils.js +0 -0
  41. /package/{dist/deparser → deparser}/utils/sql-formatter.d.ts +0 -0
  42. /package/{dist/esm → esm}/deparser/index.js +0 -0
  43. /package/{dist/esm → esm}/deparser/utils/list-utils.js +0 -0
  44. /package/{dist/esm → esm}/deparser/utils/quote-utils.js +0 -0
  45. /package/{dist/esm → esm}/index.js +0 -0
  46. /package/{dist/esm → esm}/v14-to-v17-direct.js +0 -0
  47. /package/{dist/esm → esm}/v16-to-v17.js +0 -0
  48. /package/{dist/index.d.ts → index.d.ts} +0 -0
  49. /package/{dist/index.js → index.js} +0 -0
  50. /package/{dist/v14-to-v15.d.ts → v14-to-v15.d.ts} +0 -0
  51. /package/{dist/v14-to-v17-direct.d.ts → v14-to-v17-direct.d.ts} +0 -0
  52. /package/{dist/v14-to-v17-direct.js → v14-to-v17-direct.js} +0 -0
  53. /package/{dist/v16-to-v17.d.ts → v16-to-v17.d.ts} +0 -0
  54. /package/{dist/v16-to-v17.js → v16-to-v17.js} +0 -0
package/src/v14-to-v15.ts DELETED
@@ -1,1621 +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
-
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.newowner !== undefined) {
818
- result.newowner = this.transform(node.newowner as any, context);
819
- }
820
- if (node.def !== undefined) {
821
- result.def = this.transform(node.def as any, context);
822
- }
823
- if (node.behavior !== undefined) {
824
- result.behavior = node.behavior;
825
- }
826
- if (node.missing_ok !== undefined) {
827
- result.missing_ok = node.missing_ok;
828
- }
829
- return { AlterTableCmd: result };
830
- }
831
- CreateFunctionStmt(node: any, context: any): {
832
- CreateFunctionStmt: any;
833
- } {
834
- const result = this.transformGenericNode(node, context);
835
- return { CreateFunctionStmt: result };
836
- }
837
- FunctionParameter(node: any, context: any): {
838
- FunctionParameter: any;
839
- } {
840
- const result = this.transformGenericNode(node, context);
841
- return { FunctionParameter: result };
842
- }
843
- CompositeTypeStmt(node: any, context: any): {
844
- CompositeTypeStmt: any;
845
- } {
846
- const result = this.transformGenericNode(node, context);
847
- return { CompositeTypeStmt: result };
848
- }
849
- CreateEnumStmt(node: any, context: any): {
850
- CreateEnumStmt: any;
851
- } {
852
- const result = this.transformGenericNode(node, context);
853
- return { CreateEnumStmt: result };
854
- }
855
- CreateDomainStmt(node: any, context: any): {
856
- CreateDomainStmt: any;
857
- } {
858
- const result = this.transformGenericNode(node, context);
859
- return { CreateDomainStmt: result };
860
- }
861
- CreateRoleStmt(node: any, context: any): {
862
- CreateRoleStmt: any;
863
- } {
864
- const result = this.transformGenericNode(node, context);
865
- return { CreateRoleStmt: result };
866
- }
867
- DefElem(node: any, context: any): {
868
- DefElem: any;
869
- } {
870
- const result: any = {};
871
- if (node.defnamespace !== undefined) {
872
- result.defnamespace = node.defnamespace;
873
- }
874
- if (node.defname !== undefined) {
875
- result.defname = node.defname;
876
- }
877
- if (node.arg !== undefined) {
878
- const argContext = {
879
- ...context,
880
- defElemName: node.defname,
881
- parentNodeTypes: [...(context.parentNodeTypes || []), 'DefElem']
882
- };
883
- result.arg = this.transform(node.arg as any, argContext);
884
- }
885
- if (node.defaction !== undefined) {
886
- result.defaction = node.defaction;
887
- }
888
- if (node.location !== undefined) {
889
- result.location = node.location;
890
- }
891
- return { DefElem: result };
892
- }
893
- CreateTableSpaceStmt(node: any, context: any): {
894
- CreateTableSpaceStmt: any;
895
- } {
896
- const result = this.transformGenericNode(node, context);
897
- return { CreateTableSpaceStmt: result };
898
- }
899
- DropTableSpaceStmt(node: any, context: any): {
900
- DropTableSpaceStmt: any;
901
- } {
902
- const result = this.transformGenericNode(node, context);
903
- return { DropTableSpaceStmt: result };
904
- }
905
- AlterTableSpaceOptionsStmt(node: any, context: any): {
906
- AlterTableSpaceOptionsStmt: any;
907
- } {
908
- const result = this.transformGenericNode(node, context);
909
- return { AlterTableSpaceOptionsStmt: result };
910
- }
911
- CreateExtensionStmt(node: any, context: any): {
912
- CreateExtensionStmt: any;
913
- } {
914
- const result = this.transformGenericNode(node, context);
915
- return { CreateExtensionStmt: result };
916
- }
917
- AlterExtensionStmt(node: any, context: any): {
918
- AlterExtensionStmt: any;
919
- } {
920
- const result = this.transformGenericNode(node, context);
921
- return { AlterExtensionStmt: result };
922
- }
923
- CreateFdwStmt(node: any, context: any): {
924
- CreateFdwStmt: any;
925
- } {
926
- const result = this.transformGenericNode(node, context);
927
- return { CreateFdwStmt: result };
928
- }
929
- SetOperationStmt(node: any, context: any): {
930
- SetOperationStmt: any;
931
- } {
932
- const result = this.transformGenericNode(node, context);
933
- return { SetOperationStmt: result };
934
- }
935
- ReplicaIdentityStmt(node: any, context: any): {
936
- ReplicaIdentityStmt: any;
937
- } {
938
- const result = this.transformGenericNode(node, context);
939
- return { ReplicaIdentityStmt: result };
940
- }
941
- AlterCollationStmt(node: any, context: any): {
942
- AlterCollationStmt: any;
943
- } {
944
- const result = this.transformGenericNode(node, context);
945
- return { AlterCollationStmt: result };
946
- }
947
- AlterDomainStmt(node: any, context: any): {
948
- AlterDomainStmt: any;
949
- } {
950
- const result = this.transformGenericNode(node, context);
951
- return { AlterDomainStmt: result };
952
- }
953
- PrepareStmt(node: any, context: any): {
954
- PrepareStmt: any;
955
- } {
956
- const result = this.transformGenericNode(node, context);
957
- return { PrepareStmt: result };
958
- }
959
- ExecuteStmt(node: any, context: any): {
960
- ExecuteStmt: any;
961
- } {
962
- const result = this.transformGenericNode(node, context);
963
- return { ExecuteStmt: result };
964
- }
965
- DeallocateStmt(node: any, context: any): {
966
- DeallocateStmt: any;
967
- } {
968
- const result = this.transformGenericNode(node, context);
969
- return { DeallocateStmt: result };
970
- }
971
- NotifyStmt(node: any, context: any): {
972
- NotifyStmt: any;
973
- } {
974
- const result = this.transformGenericNode(node, context);
975
- return { NotifyStmt: result };
976
- }
977
- ListenStmt(node: any, context: any): {
978
- ListenStmt: any;
979
- } {
980
- const result = this.transformGenericNode(node, context);
981
- return { ListenStmt: result };
982
- }
983
- UnlistenStmt(node: any, context: any): {
984
- UnlistenStmt: any;
985
- } {
986
- const result = this.transformGenericNode(node, context);
987
- return { UnlistenStmt: result };
988
- }
989
- CheckPointStmt(node: any, context: any): {
990
- CheckPointStmt: any;
991
- } {
992
- const result = this.transformGenericNode(node, context);
993
- return { CheckPointStmt: result };
994
- }
995
- LoadStmt(node: any, context: any): {
996
- LoadStmt: any;
997
- } {
998
- const result = this.transformGenericNode(node, context);
999
- return { LoadStmt: result };
1000
- }
1001
- DiscardStmt(node: any, context: any): {
1002
- DiscardStmt: any;
1003
- } {
1004
- const result = this.transformGenericNode(node, context);
1005
- return { DiscardStmt: result };
1006
- }
1007
- CommentStmt(node: any, context: any): {
1008
- CommentStmt: any;
1009
- } {
1010
- const result = this.transformGenericNode(node, context);
1011
- return { CommentStmt: result };
1012
- }
1013
- LockStmt(node: any, context: any): {
1014
- LockStmt: any;
1015
- } {
1016
- const result = this.transformGenericNode(node, context);
1017
- return { LockStmt: result };
1018
- }
1019
- CreatePolicyStmt(node: any, context: any): {
1020
- CreatePolicyStmt: any;
1021
- } {
1022
- const result = this.transformGenericNode(node, context);
1023
- return { CreatePolicyStmt: result };
1024
- }
1025
- AlterPolicyStmt(node: any, context: any): {
1026
- AlterPolicyStmt: any;
1027
- } {
1028
- const result = this.transformGenericNode(node, context);
1029
- return { AlterPolicyStmt: result };
1030
- }
1031
- CreateUserMappingStmt(node: any, context: any): {
1032
- CreateUserMappingStmt: any;
1033
- } {
1034
- const result = this.transformGenericNode(node, context);
1035
- return { CreateUserMappingStmt: result };
1036
- }
1037
- CreateStatsStmt(node: any, context: any): {
1038
- CreateStatsStmt: any;
1039
- } {
1040
- const result = this.transformGenericNode(node, context);
1041
- return { CreateStatsStmt: result };
1042
- }
1043
- StatsElem(node: any, context: any): {
1044
- StatsElem: any;
1045
- } {
1046
- const result = this.transformGenericNode(node, context);
1047
- return { StatsElem: result };
1048
- }
1049
- CreatePublicationStmt(node: any, context: any): {
1050
- CreatePublicationStmt: any;
1051
- } {
1052
- const result = this.transformGenericNode(node, context);
1053
- return { CreatePublicationStmt: result };
1054
- }
1055
- CreateSubscriptionStmt(node: any, context: any): {
1056
- CreateSubscriptionStmt: any;
1057
- } {
1058
- const result = this.transformGenericNode(node, context);
1059
- return { CreateSubscriptionStmt: result };
1060
- }
1061
- AlterPublicationStmt(node: any, context: any): {
1062
- AlterPublicationStmt: any;
1063
- } {
1064
- const result = this.transformGenericNode(node, context);
1065
- return { AlterPublicationStmt: result };
1066
- }
1067
- AlterSubscriptionStmt(node: any, context: any): {
1068
- AlterSubscriptionStmt: any;
1069
- } {
1070
- const result = this.transformGenericNode(node, context);
1071
- return { AlterSubscriptionStmt: result };
1072
- }
1073
- DropSubscriptionStmt(node: any, context: any): {
1074
- DropSubscriptionStmt: any;
1075
- } {
1076
- const result = this.transformGenericNode(node, context);
1077
- return { DropSubscriptionStmt: result };
1078
- }
1079
- DoStmt(node: any, context: any): {
1080
- DoStmt: any;
1081
- } {
1082
- const result = this.transformGenericNode(node, context);
1083
- return { DoStmt: result };
1084
- }
1085
- InlineCodeBlock(node: any, context: any): {
1086
- InlineCodeBlock: any;
1087
- } {
1088
- const result = this.transformGenericNode(node, context);
1089
- return { InlineCodeBlock: result };
1090
- }
1091
- CallContext(node: any, context: any): {
1092
- CallContext: any;
1093
- } {
1094
- const result = this.transformGenericNode(node, context);
1095
- return { CallContext: result };
1096
- }
1097
- ConstraintsSetStmt(node: any, context: any): {
1098
- ConstraintsSetStmt: any;
1099
- } {
1100
- const result = this.transformGenericNode(node, context);
1101
- return { ConstraintsSetStmt: result };
1102
- }
1103
- AlterSystemStmt(node: any, context: any): {
1104
- AlterSystemStmt: any;
1105
- } {
1106
- const result = this.transformGenericNode(node, context);
1107
- return { AlterSystemStmt: result };
1108
- }
1109
- VacuumRelation(node: any, context: any): {
1110
- VacuumRelation: any;
1111
- } {
1112
- const result = this.transformGenericNode(node, context);
1113
- return { VacuumRelation: result };
1114
- }
1115
- DropOwnedStmt(node: any, context: any): {
1116
- DropOwnedStmt: any;
1117
- } {
1118
- const result = this.transformGenericNode(node, context);
1119
- return { DropOwnedStmt: result };
1120
- }
1121
- ReassignOwnedStmt(node: any, context: any): {
1122
- ReassignOwnedStmt: any;
1123
- } {
1124
- const result = this.transformGenericNode(node, context);
1125
- return { ReassignOwnedStmt: result };
1126
- }
1127
- AlterTSDictionaryStmt(node: any, context: any): {
1128
- AlterTSDictionaryStmt: any;
1129
- } {
1130
- const result = this.transformGenericNode(node, context);
1131
- return { AlterTSDictionaryStmt: result };
1132
- }
1133
- AlterTSConfigurationStmt(node: any, context: any): {
1134
- AlterTSConfigurationStmt: any;
1135
- } {
1136
- const result = this.transformGenericNode(node, context);
1137
- return { AlterTSConfigurationStmt: result };
1138
- }
1139
- ClosePortalStmt(node: any, context: any): {
1140
- ClosePortalStmt: any;
1141
- } {
1142
- const result = this.transformGenericNode(node, context);
1143
- return { ClosePortalStmt: result };
1144
- }
1145
- FetchStmt(node: any, context: any): {
1146
- FetchStmt: any;
1147
- } {
1148
- const result = this.transformGenericNode(node, context);
1149
- return { FetchStmt: result };
1150
- }
1151
- AlterStatsStmt(node: any, context: any): {
1152
- AlterStatsStmt: any;
1153
- } {
1154
- const result = this.transformGenericNode(node, context);
1155
- return { AlterStatsStmt: result };
1156
- }
1157
- ObjectWithArgs(node: any, context: any): {
1158
- ObjectWithArgs: any;
1159
- } {
1160
- const result = this.transformGenericNode(node, context);
1161
- return { ObjectWithArgs: result };
1162
- }
1163
- AlterOperatorStmt(node: any, context: any): {
1164
- AlterOperatorStmt: any;
1165
- } {
1166
- const result = this.transformGenericNode(node, context);
1167
- return { AlterOperatorStmt: result };
1168
- }
1169
- AlterFdwStmt(node: any, context: any): {
1170
- AlterFdwStmt: any;
1171
- } {
1172
- const result = this.transformGenericNode(node, context);
1173
- return { AlterFdwStmt: result };
1174
- }
1175
- CreateForeignServerStmt(node: any, context: any): {
1176
- CreateForeignServerStmt: any;
1177
- } {
1178
- const result = this.transformGenericNode(node, context);
1179
- return { CreateForeignServerStmt: result };
1180
- }
1181
- AlterForeignServerStmt(node: any, context: any): {
1182
- AlterForeignServerStmt: any;
1183
- } {
1184
- const result = this.transformGenericNode(node, context);
1185
- return { AlterForeignServerStmt: result };
1186
- }
1187
- AlterUserMappingStmt(node: any, context: any): {
1188
- AlterUserMappingStmt: any;
1189
- } {
1190
- const result = this.transformGenericNode(node, context);
1191
- return { AlterUserMappingStmt: result };
1192
- }
1193
- DropUserMappingStmt(node: any, context: any): {
1194
- DropUserMappingStmt: any;
1195
- } {
1196
- const result = this.transformGenericNode(node, context);
1197
- return { DropUserMappingStmt: result };
1198
- }
1199
- ImportForeignSchemaStmt(node: any, context: any): {
1200
- ImportForeignSchemaStmt: any;
1201
- } {
1202
- const result = this.transformGenericNode(node, context);
1203
- return { ImportForeignSchemaStmt: result };
1204
- }
1205
- ClusterStmt(node: any, context: any): {
1206
- ClusterStmt: any;
1207
- } {
1208
- const result = this.transformGenericNode(node, context);
1209
- return { ClusterStmt: result };
1210
- }
1211
- VacuumStmt(node: any, context: any): {
1212
- VacuumStmt: any;
1213
- } {
1214
- const result = this.transformGenericNode(node, context);
1215
- return { VacuumStmt: result };
1216
- }
1217
- ExplainStmt(node: any, context: any): {
1218
- ExplainStmt: any;
1219
- } {
1220
- const result = this.transformGenericNode(node, context);
1221
- return { ExplainStmt: result };
1222
- }
1223
- ReindexStmt(node: any, context: any): {
1224
- ReindexStmt: any;
1225
- } {
1226
- const result = this.transformGenericNode(node, context);
1227
- return { ReindexStmt: result };
1228
- }
1229
- CallStmt(node: any, context: any): {
1230
- CallStmt: any;
1231
- } {
1232
- const result = this.transformGenericNode(node, context);
1233
- return { CallStmt: result };
1234
- }
1235
- CreatedbStmt(node: any, context: any): {
1236
- CreatedbStmt: any;
1237
- } {
1238
- const result = this.transformGenericNode(node, context);
1239
- return { CreatedbStmt: result };
1240
- }
1241
- DropdbStmt(node: any, context: any): {
1242
- DropdbStmt: any;
1243
- } {
1244
- const result = this.transformGenericNode(node, context);
1245
- return { DropdbStmt: result };
1246
- }
1247
- RenameStmt(node: any, context: any): {
1248
- RenameStmt: any;
1249
- } {
1250
- const result = this.transformGenericNode(node, context);
1251
- return { RenameStmt: result };
1252
- }
1253
- AlterOwnerStmt(node: any, context: any): {
1254
- AlterOwnerStmt: any;
1255
- } {
1256
- const result = this.transformGenericNode(node, context);
1257
- return { AlterOwnerStmt: result };
1258
- }
1259
- GrantStmt(node: any, context: any): {
1260
- GrantStmt: any;
1261
- } {
1262
- const result = this.transformGenericNode(node, context);
1263
- return { GrantStmt: result };
1264
- }
1265
- GrantRoleStmt(node: any, context: any): {
1266
- GrantRoleStmt: any;
1267
- } {
1268
- const result = this.transformGenericNode(node, context);
1269
- return { GrantRoleStmt: result };
1270
- }
1271
- SecLabelStmt(node: any, context: any): {
1272
- SecLabelStmt: any;
1273
- } {
1274
- const result = this.transformGenericNode(node, context);
1275
- return { SecLabelStmt: result };
1276
- }
1277
- AlterDefaultPrivilegesStmt(node: any, context: any): {
1278
- AlterDefaultPrivilegesStmt: any;
1279
- } {
1280
- const result = this.transformGenericNode(node, context);
1281
- return { AlterDefaultPrivilegesStmt: result };
1282
- }
1283
- CreateConversionStmt(node: any, context: any): {
1284
- CreateConversionStmt: any;
1285
- } {
1286
- const result = this.transformGenericNode(node, context);
1287
- return { CreateConversionStmt: result };
1288
- }
1289
- CreateCastStmt(node: any, context: any): {
1290
- CreateCastStmt: any;
1291
- } {
1292
- const result = this.transformGenericNode(node, context);
1293
- return { CreateCastStmt: result };
1294
- }
1295
- CreatePLangStmt(node: any, context: any): {
1296
- CreatePLangStmt: any;
1297
- } {
1298
- const result = this.transformGenericNode(node, context);
1299
- return { CreatePLangStmt: result };
1300
- }
1301
- CreateTransformStmt(node: any, context: any): {
1302
- CreateTransformStmt: any;
1303
- } {
1304
- const result = this.transformGenericNode(node, context);
1305
- return { CreateTransformStmt: result };
1306
- }
1307
- CreateTrigStmt(node: any, context: any): {
1308
- CreateTrigStmt: any;
1309
- } {
1310
- const result = this.transformGenericNode(node, context);
1311
- return { CreateTrigStmt: result };
1312
- }
1313
- TriggerTransition(node: any, context: any): {
1314
- TriggerTransition: any;
1315
- } {
1316
- const result = this.transformGenericNode(node, context);
1317
- return { TriggerTransition: result };
1318
- }
1319
- CreateEventTrigStmt(node: any, context: any): {
1320
- CreateEventTrigStmt: any;
1321
- } {
1322
- const result = this.transformGenericNode(node, context);
1323
- return { CreateEventTrigStmt: result };
1324
- }
1325
- AlterEventTrigStmt(node: any, context: any): {
1326
- AlterEventTrigStmt: any;
1327
- } {
1328
- const result = this.transformGenericNode(node, context);
1329
- return { AlterEventTrigStmt: result };
1330
- }
1331
- CreateOpClassStmt(node: any, context: any): {
1332
- CreateOpClassStmt: any;
1333
- } {
1334
- const result = this.transformGenericNode(node, context);
1335
- return { CreateOpClassStmt: result };
1336
- }
1337
- CreateOpFamilyStmt(node: any, context: any): {
1338
- CreateOpFamilyStmt: any;
1339
- } {
1340
- const result = this.transformGenericNode(node, context);
1341
- return { CreateOpFamilyStmt: result };
1342
- }
1343
- AlterOpFamilyStmt(node: any, context: any): {
1344
- AlterOpFamilyStmt: any;
1345
- } {
1346
- const result = this.transformGenericNode(node, context);
1347
- return { AlterOpFamilyStmt: result };
1348
- }
1349
- AlterTableMoveAllStmt(node: any, context: any): {
1350
- AlterTableMoveAllStmt: any;
1351
- } {
1352
- const result = this.transformGenericNode(node, context);
1353
- return { AlterTableMoveAllStmt: result };
1354
- }
1355
- CreateSeqStmt(node: any, context: any): {
1356
- CreateSeqStmt: any;
1357
- } {
1358
- const result = this.transformGenericNode(node, context);
1359
- return { CreateSeqStmt: result };
1360
- }
1361
- AlterSeqStmt(node: any, context: any): {
1362
- AlterSeqStmt: any;
1363
- } {
1364
- const result = this.transformGenericNode(node, context);
1365
- return { AlterSeqStmt: result };
1366
- }
1367
- CreateRangeStmt(node: any, context: any): {
1368
- CreateRangeStmt: any;
1369
- } {
1370
- const result = this.transformGenericNode(node, context);
1371
- return { CreateRangeStmt: result };
1372
- }
1373
- AlterEnumStmt(node: any, context: any): {
1374
- AlterEnumStmt: any;
1375
- } {
1376
- const result = this.transformGenericNode(node, context);
1377
- return { AlterEnumStmt: result };
1378
- }
1379
- AlterTypeStmt(node: any, context: any): {
1380
- AlterTypeStmt: any;
1381
- } {
1382
- const result = this.transformGenericNode(node, context);
1383
- return { AlterTypeStmt: result };
1384
- }
1385
- AlterRoleStmt(node: any, context: any): {
1386
- AlterRoleStmt: any;
1387
- } {
1388
- const result = this.transformGenericNode(node, context);
1389
- return { AlterRoleStmt: result };
1390
- }
1391
- DropRoleStmt(node: any, context: any): {
1392
- DropRoleStmt: any;
1393
- } {
1394
- const result = this.transformGenericNode(node, context);
1395
- return { DropRoleStmt: result };
1396
- }
1397
- CreateTableAsStmt(node: any, context: any): {
1398
- CreateTableAsStmt: any;
1399
- } {
1400
- const result = this.transformGenericNode(node, context);
1401
- return { CreateTableAsStmt: result };
1402
- }
1403
- RefreshMatViewStmt(node: any, context: any): {
1404
- RefreshMatViewStmt: any;
1405
- } {
1406
- const result = this.transformGenericNode(node, context);
1407
- return { RefreshMatViewStmt: result };
1408
- }
1409
- AccessPriv(node: any, context: any): {
1410
- AccessPriv: any;
1411
- } {
1412
- const result = this.transformGenericNode(node, context);
1413
- return { AccessPriv: result };
1414
- }
1415
- DefineStmt(node: any, context: any): {
1416
- DefineStmt: any;
1417
- } {
1418
- const result: any = {};
1419
- if (node.kind !== undefined) {
1420
- result.kind = node.kind;
1421
- }
1422
- if (node.oldstyle !== undefined) {
1423
- result.oldstyle = node.oldstyle;
1424
- }
1425
- if (node.defnames !== undefined) {
1426
- result.defnames = Array.isArray(node.defnames)
1427
- ? node.defnames.map(item => this.transform(item as any, context))
1428
- : this.transform(node.defnames as any, context);
1429
- }
1430
- if (node.args !== undefined) {
1431
- result.args = Array.isArray(node.args)
1432
- ? node.args.map(item => this.transform(item as any, context))
1433
- : this.transform(node.args as any, context);
1434
- }
1435
- if (node.definition !== undefined) {
1436
- result.definition = Array.isArray(node.definition)
1437
- ? node.definition.map(item => this.transform(item as any, context))
1438
- : this.transform(node.definition as any, context);
1439
- }
1440
- if (node.if_not_exists !== undefined) {
1441
- result.if_not_exists = node.if_not_exists;
1442
- }
1443
- if (node.replace !== undefined) {
1444
- result.replace = node.replace;
1445
- }
1446
- return { DefineStmt: result };
1447
- }
1448
- AlterDatabaseStmt(node: any, context: any): {
1449
- AlterDatabaseStmt: any;
1450
- } {
1451
- const result = this.transformGenericNode(node, context);
1452
- return { AlterDatabaseStmt: result };
1453
- }
1454
- AlterDatabaseSetStmt(node: any, context: any): {
1455
- AlterDatabaseSetStmt: any;
1456
- } {
1457
- const result = this.transformGenericNode(node, context);
1458
- return { AlterDatabaseSetStmt: result };
1459
- }
1460
- DeclareCursorStmt(node: any, context: any): {
1461
- DeclareCursorStmt: any;
1462
- } {
1463
- const result = this.transformGenericNode(node, context);
1464
- return { DeclareCursorStmt: result };
1465
- }
1466
- CreateAmStmt(node: any, context: any): {
1467
- CreateAmStmt: any;
1468
- } {
1469
- const result = this.transformGenericNode(node, context);
1470
- return { CreateAmStmt: result };
1471
- }
1472
- IntoClause(node: any, context: any): {
1473
- IntoClause: any;
1474
- } {
1475
- const result = this.transformGenericNode(node, context);
1476
- return { IntoClause: result };
1477
- }
1478
- OnConflictExpr(node: any, context: any): {
1479
- OnConflictExpr: any;
1480
- } {
1481
- const result = this.transformGenericNode(node, context);
1482
- return { OnConflictExpr: result };
1483
- }
1484
- ScanToken(node: any, context: any): {
1485
- ScanToken: any;
1486
- } {
1487
- const result = this.transformGenericNode(node, context);
1488
- return { ScanToken: result };
1489
- }
1490
- CreateOpClassItem(node: any, context: any): {
1491
- CreateOpClassItem: any;
1492
- } {
1493
- const result = this.transformGenericNode(node, context);
1494
- return { CreateOpClassItem: result };
1495
- }
1496
- Var(node: any, context: any): {
1497
- Var: any;
1498
- } {
1499
- const result = this.transformGenericNode(node, context);
1500
- return { Var: result };
1501
- }
1502
- TableFunc(node: any, context: any): {
1503
- TableFunc: any;
1504
- } {
1505
- const result = this.transformGenericNode(node, context);
1506
- return { TableFunc: result };
1507
- }
1508
- RangeTableFunc(node: any, context: any): {
1509
- RangeTableFunc: any;
1510
- } {
1511
- const result = this.transformGenericNode(node, context);
1512
- return { RangeTableFunc: result };
1513
- }
1514
- RangeTableFuncCol(node: any, context: any): {
1515
- RangeTableFuncCol: any;
1516
- } {
1517
- const result = this.transformGenericNode(node, context);
1518
- return { RangeTableFuncCol: result };
1519
- }
1520
- RangeFunction(node: any, context: any): {
1521
- RangeFunction: any;
1522
- } {
1523
- const result = this.transformGenericNode(node, context);
1524
- return { RangeFunction: result };
1525
- }
1526
- XmlExpr(node: any, context: any): {
1527
- XmlExpr: any;
1528
- } {
1529
- const result = this.transformGenericNode(node, context);
1530
- return { XmlExpr: result };
1531
- }
1532
- RangeTableSample(node: any, context: any): {
1533
- RangeTableSample: any;
1534
- } {
1535
- const result = this.transformGenericNode(node, context);
1536
- return { RangeTableSample: result };
1537
- }
1538
- XmlSerialize(node: any, context: any): {
1539
- XmlSerialize: any;
1540
- } {
1541
- const result = this.transformGenericNode(node, context);
1542
- return { XmlSerialize: result };
1543
- }
1544
- RuleStmt(node: any, context: any): {
1545
- RuleStmt: any;
1546
- } {
1547
- const result = this.transformGenericNode(node, context);
1548
- return { RuleStmt: result };
1549
- }
1550
- RangeSubselect(node: any, context: any): {
1551
- RangeSubselect: any;
1552
- } {
1553
- const result = this.transformGenericNode(node, context);
1554
- return { RangeSubselect: result };
1555
- }
1556
- SQLValueFunction(node: any, context: any): {
1557
- SQLValueFunction: any;
1558
- } {
1559
- const result = this.transformGenericNode(node, context);
1560
- return { SQLValueFunction: result };
1561
- }
1562
- GroupingFunc(node: any, context: any): {
1563
- GroupingFunc: any;
1564
- } {
1565
- const result = this.transformGenericNode(node, context);
1566
- return { GroupingFunc: result };
1567
- }
1568
- MultiAssignRef(node: any, context: any): {
1569
- MultiAssignRef: any;
1570
- } {
1571
- const result = this.transformGenericNode(node, context);
1572
- return { MultiAssignRef: result };
1573
- }
1574
- SetToDefault(node: any, context: any): {
1575
- SetToDefault: any;
1576
- } {
1577
- const result = this.transformGenericNode(node, context);
1578
- return { SetToDefault: result };
1579
- }
1580
- CurrentOfExpr(node: any, context: any): {
1581
- CurrentOfExpr: any;
1582
- } {
1583
- const result = this.transformGenericNode(node, context);
1584
- return { CurrentOfExpr: result };
1585
- }
1586
- TableLikeClause(node: any, context: any): {
1587
- TableLikeClause: any;
1588
- } {
1589
- const result = this.transformGenericNode(node, context);
1590
- return { TableLikeClause: result };
1591
- }
1592
- AlterFunctionStmt(node: any, context: any): {
1593
- AlterFunctionStmt: any;
1594
- } {
1595
- const result = this.transformGenericNode(node, context);
1596
- return { AlterFunctionStmt: result };
1597
- }
1598
- AlterObjectSchemaStmt(node: any, context: any): {
1599
- AlterObjectSchemaStmt: any;
1600
- } {
1601
- const result = this.transformGenericNode(node, context);
1602
- return { AlterObjectSchemaStmt: result };
1603
- }
1604
- AlterRoleSetStmt(node: any, context: any): {
1605
- AlterRoleSetStmt: any;
1606
- } {
1607
- const result = this.transformGenericNode(node, context);
1608
- return { AlterRoleSetStmt: result };
1609
- }
1610
- CreateForeignTableStmt(node: any, context: any): {
1611
- CreateForeignTableStmt: any;
1612
- } {
1613
- const result = this.transformGenericNode(node, context);
1614
- return { CreateForeignTableStmt: result };
1615
- }
1616
- // NOTE: this doesn't exist in v14?
1617
- CreateAccessMethodStmt(node: any, context: any): any {
1618
- const result = this.transformGenericNode(node, context);
1619
- return { CreateAccessMethodStmt: result };
1620
- }
1621
- }