pg-ast 0.0.1 → 2.0.2

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.
package/module/index.js DELETED
@@ -1,2096 +0,0 @@
1
- export const jsonSet = (vresult, prop, value) => {
2
- if (typeof value !== 'undefined') vresult[prop] = value;
3
- return vresult;
4
- };
5
- export const RawStmt = ({
6
- stmt
7
- }) => {
8
- let vresult = {};
9
- vresult = jsonSet(vresult, 'stmt', stmt);
10
- return {
11
- RawStmt: vresult
12
- };
13
- };
14
- export const CreateSchemaStmt = ({
15
- schemaname,
16
- if_not_exists,
17
- schemaElts,
18
- authrole
19
- }) => {
20
- let vresult = {};
21
- vresult = jsonSet(vresult, 'schemaname', schemaname);
22
- vresult = jsonSet(vresult, 'if_not_exists', if_not_exists);
23
- vresult = jsonSet(vresult, 'schemaElts', schemaElts);
24
- vresult = jsonSet(vresult, 'authrole', authrole);
25
- return {
26
- CreateSchemaStmt: vresult
27
- };
28
- };
29
- export const CreateStmt = ({
30
- relation,
31
- tableElts,
32
- oncommit,
33
- inhRelations,
34
- options,
35
- ofTypename,
36
- if_not_exists
37
- }) => {
38
- let vresult = {};
39
- vresult = jsonSet(vresult, 'relation', relation);
40
- vresult = jsonSet(vresult, 'tableElts', tableElts);
41
- vresult = jsonSet(vresult, 'oncommit', oncommit);
42
- vresult = jsonSet(vresult, 'inhRelations', inhRelations);
43
- vresult = jsonSet(vresult, 'options', options);
44
- vresult = jsonSet(vresult, 'ofTypename', ofTypename);
45
- vresult = jsonSet(vresult, 'if_not_exists', if_not_exists);
46
- return {
47
- CreateStmt: vresult
48
- };
49
- };
50
- export const RangeVar = ({
51
- schemaname,
52
- relname,
53
- inh,
54
- relpersistence,
55
- alias
56
- }) => {
57
- let vresult = {};
58
- vresult = jsonSet(vresult, 'schemaname', schemaname);
59
- vresult = jsonSet(vresult, 'relname', relname);
60
- vresult = jsonSet(vresult, 'inh', inh);
61
- vresult = jsonSet(vresult, 'relpersistence', relpersistence);
62
- vresult = jsonSet(vresult, 'alias', alias);
63
- return {
64
- RangeVar: vresult
65
- };
66
- };
67
- export const ColumnDef = ({
68
- colname,
69
- typeName,
70
- is_local,
71
- constraints,
72
- raw_default,
73
- collClause,
74
- fdwoptions
75
- }) => {
76
- let vresult = {};
77
- vresult = jsonSet(vresult, 'colname', colname);
78
- vresult = jsonSet(vresult, 'typeName', typeName);
79
- vresult = jsonSet(vresult, 'is_local', is_local);
80
- vresult = jsonSet(vresult, 'constraints', constraints);
81
- vresult = jsonSet(vresult, 'raw_default', raw_default);
82
- vresult = jsonSet(vresult, 'collClause', collClause);
83
- vresult = jsonSet(vresult, 'fdwoptions', fdwoptions);
84
- return {
85
- ColumnDef: vresult
86
- };
87
- };
88
- export const TypeName = ({
89
- names,
90
- typemod,
91
- typmods,
92
- setof,
93
- arrayBounds
94
- }) => {
95
- let vresult = {};
96
- vresult = jsonSet(vresult, 'names', names);
97
- vresult = jsonSet(vresult, 'typemod', typemod);
98
- vresult = jsonSet(vresult, 'typmods', typmods);
99
- vresult = jsonSet(vresult, 'setof', setof);
100
- vresult = jsonSet(vresult, 'arrayBounds', arrayBounds);
101
- return {
102
- TypeName: vresult
103
- };
104
- };
105
- export const String = ({
106
- str
107
- }) => {
108
- let vresult = {};
109
- vresult = jsonSet(vresult, 'str', str);
110
- return {
111
- String: vresult
112
- };
113
- };
114
- export const Constraint = ({
115
- contype,
116
- raw_expr,
117
- conname,
118
- pktable,
119
- fk_attrs,
120
- pk_attrs,
121
- fk_matchtype,
122
- fk_upd_action,
123
- fk_del_action,
124
- initially_valid,
125
- keys,
126
- is_no_inherit,
127
- skip_validation,
128
- exclusions,
129
- access_method,
130
- deferrable,
131
- indexname
132
- }) => {
133
- let vresult = {};
134
- vresult = jsonSet(vresult, 'contype', contype);
135
- vresult = jsonSet(vresult, 'raw_expr', raw_expr);
136
- vresult = jsonSet(vresult, 'conname', conname);
137
- vresult = jsonSet(vresult, 'pktable', pktable);
138
- vresult = jsonSet(vresult, 'fk_attrs', fk_attrs);
139
- vresult = jsonSet(vresult, 'pk_attrs', pk_attrs);
140
- vresult = jsonSet(vresult, 'fk_matchtype', fk_matchtype);
141
- vresult = jsonSet(vresult, 'fk_upd_action', fk_upd_action);
142
- vresult = jsonSet(vresult, 'fk_del_action', fk_del_action);
143
- vresult = jsonSet(vresult, 'initially_valid', initially_valid);
144
- vresult = jsonSet(vresult, 'keys', keys);
145
- vresult = jsonSet(vresult, 'is_no_inherit', is_no_inherit);
146
- vresult = jsonSet(vresult, 'skip_validation', skip_validation);
147
- vresult = jsonSet(vresult, 'exclusions', exclusions);
148
- vresult = jsonSet(vresult, 'access_method', access_method);
149
- vresult = jsonSet(vresult, 'deferrable', deferrable);
150
- vresult = jsonSet(vresult, 'indexname', indexname);
151
- return {
152
- Constraint: vresult
153
- };
154
- };
155
- export const A_Const = ({
156
- val
157
- }) => {
158
- let vresult = {};
159
- vresult = jsonSet(vresult, 'val', val);
160
- return {
161
- A_Const: vresult
162
- };
163
- };
164
- export const Integer = ({
165
- ival
166
- }) => {
167
- let vresult = {};
168
- vresult = jsonSet(vresult, 'ival', ival);
169
- return {
170
- Integer: vresult
171
- };
172
- };
173
- export const AlterTableStmt = ({
174
- relation,
175
- cmds,
176
- relkind,
177
- missing_ok
178
- }) => {
179
- let vresult = {};
180
- vresult = jsonSet(vresult, 'relation', relation);
181
- vresult = jsonSet(vresult, 'cmds', cmds);
182
- vresult = jsonSet(vresult, 'relkind', relkind);
183
- vresult = jsonSet(vresult, 'missing_ok', missing_ok);
184
- return {
185
- AlterTableStmt: vresult
186
- };
187
- };
188
- export const AlterTableCmd = ({
189
- subtype,
190
- behavior,
191
- name,
192
- def,
193
- missing_ok,
194
- newowner
195
- }) => {
196
- let vresult = {};
197
- vresult = jsonSet(vresult, 'subtype', subtype);
198
- vresult = jsonSet(vresult, 'behavior', behavior);
199
- vresult = jsonSet(vresult, 'name', name);
200
- vresult = jsonSet(vresult, 'def', def);
201
- vresult = jsonSet(vresult, 'missing_ok', missing_ok);
202
- vresult = jsonSet(vresult, 'newowner', newowner);
203
- return {
204
- AlterTableCmd: vresult
205
- };
206
- };
207
- export const SQLValueFunction = ({
208
- op,
209
- typmod
210
- }) => {
211
- let vresult = {};
212
- vresult = jsonSet(vresult, 'op', op);
213
- vresult = jsonSet(vresult, 'typmod', typmod);
214
- return {
215
- SQLValueFunction: vresult
216
- };
217
- };
218
- export const RenameStmt = ({
219
- renameType,
220
- relationType,
221
- relation,
222
- subname,
223
- newname,
224
- behavior,
225
- object,
226
- missing_ok
227
- }) => {
228
- let vresult = {};
229
- vresult = jsonSet(vresult, 'renameType', renameType);
230
- vresult = jsonSet(vresult, 'relationType', relationType);
231
- vresult = jsonSet(vresult, 'relation', relation);
232
- vresult = jsonSet(vresult, 'subname', subname);
233
- vresult = jsonSet(vresult, 'newname', newname);
234
- vresult = jsonSet(vresult, 'behavior', behavior);
235
- vresult = jsonSet(vresult, 'object', object);
236
- vresult = jsonSet(vresult, 'missing_ok', missing_ok);
237
- return {
238
- RenameStmt: vresult
239
- };
240
- };
241
- export const A_Expr = ({
242
- kind,
243
- name,
244
- lexpr,
245
- rexpr
246
- }) => {
247
- let vresult = {};
248
- vresult = jsonSet(vresult, 'kind', kind);
249
- vresult = jsonSet(vresult, 'name', name);
250
- vresult = jsonSet(vresult, 'lexpr', lexpr);
251
- vresult = jsonSet(vresult, 'rexpr', rexpr);
252
- return {
253
- A_Expr: vresult
254
- };
255
- };
256
- export const TypeCast = ({
257
- arg,
258
- typeName
259
- }) => {
260
- let vresult = {};
261
- vresult = jsonSet(vresult, 'arg', arg);
262
- vresult = jsonSet(vresult, 'typeName', typeName);
263
- return {
264
- TypeCast: vresult
265
- };
266
- };
267
- export const ColumnRef = ({
268
- fields
269
- }) => {
270
- let vresult = {};
271
- vresult = jsonSet(vresult, 'fields', fields);
272
- return {
273
- ColumnRef: vresult
274
- };
275
- };
276
- export const FuncCall = ({
277
- funcname,
278
- args,
279
- agg_star,
280
- func_variadic,
281
- agg_order,
282
- agg_distinct,
283
- agg_filter,
284
- agg_within_group,
285
- over
286
- }) => {
287
- let vresult = {};
288
- vresult = jsonSet(vresult, 'funcname', funcname);
289
- vresult = jsonSet(vresult, 'args', args);
290
- vresult = jsonSet(vresult, 'agg_star', agg_star);
291
- vresult = jsonSet(vresult, 'func_variadic', func_variadic);
292
- vresult = jsonSet(vresult, 'agg_order', agg_order);
293
- vresult = jsonSet(vresult, 'agg_distinct', agg_distinct);
294
- vresult = jsonSet(vresult, 'agg_filter', agg_filter);
295
- vresult = jsonSet(vresult, 'agg_within_group', agg_within_group);
296
- vresult = jsonSet(vresult, 'over', over);
297
- return {
298
- FuncCall: vresult
299
- };
300
- };
301
- export const AlterDefaultPrivilegesStmt = ({
302
- options,
303
- action
304
- }) => {
305
- let vresult = {};
306
- vresult = jsonSet(vresult, 'options', options);
307
- vresult = jsonSet(vresult, 'action', action);
308
- return {
309
- AlterDefaultPrivilegesStmt: vresult
310
- };
311
- };
312
- export const DefElem = ({
313
- defname,
314
- arg,
315
- defaction,
316
- defnamespace
317
- }) => {
318
- let vresult = {};
319
- vresult = jsonSet(vresult, 'defname', defname);
320
- vresult = jsonSet(vresult, 'arg', arg);
321
- vresult = jsonSet(vresult, 'defaction', defaction);
322
- vresult = jsonSet(vresult, 'defnamespace', defnamespace);
323
- return {
324
- DefElem: vresult
325
- };
326
- };
327
- export const GrantStmt = ({
328
- is_grant,
329
- targtype,
330
- objtype,
331
- privileges,
332
- grantees,
333
- behavior,
334
- objects,
335
- grant_option
336
- }) => {
337
- let vresult = {};
338
- vresult = jsonSet(vresult, 'is_grant', is_grant);
339
- vresult = jsonSet(vresult, 'targtype', targtype);
340
- vresult = jsonSet(vresult, 'objtype', objtype);
341
- vresult = jsonSet(vresult, 'privileges', privileges);
342
- vresult = jsonSet(vresult, 'grantees', grantees);
343
- vresult = jsonSet(vresult, 'behavior', behavior);
344
- vresult = jsonSet(vresult, 'objects', objects);
345
- vresult = jsonSet(vresult, 'grant_option', grant_option);
346
- return {
347
- GrantStmt: vresult
348
- };
349
- };
350
- export const AccessPriv = ({
351
- priv_name,
352
- cols
353
- }) => {
354
- let vresult = {};
355
- vresult = jsonSet(vresult, 'priv_name', priv_name);
356
- vresult = jsonSet(vresult, 'cols', cols);
357
- return {
358
- AccessPriv: vresult
359
- };
360
- };
361
- export const RoleSpec = ({
362
- roletype,
363
- rolename
364
- }) => {
365
- let vresult = {};
366
- vresult = jsonSet(vresult, 'roletype', roletype);
367
- vresult = jsonSet(vresult, 'rolename', rolename);
368
- return {
369
- RoleSpec: vresult
370
- };
371
- };
372
- export const CommentStmt = ({
373
- objtype,
374
- object,
375
- comment
376
- }) => {
377
- let vresult = {};
378
- vresult = jsonSet(vresult, 'objtype', objtype);
379
- vresult = jsonSet(vresult, 'object', object);
380
- vresult = jsonSet(vresult, 'comment', comment);
381
- return {
382
- CommentStmt: vresult
383
- };
384
- };
385
- export const ObjectWithArgs = ({
386
- objname,
387
- objargs,
388
- args_unspecified
389
- }) => {
390
- let vresult = {};
391
- vresult = jsonSet(vresult, 'objname', objname);
392
- vresult = jsonSet(vresult, 'objargs', objargs);
393
- vresult = jsonSet(vresult, 'args_unspecified', args_unspecified);
394
- return {
395
- ObjectWithArgs: vresult
396
- };
397
- };
398
- export const SelectStmt = ({
399
- targetList,
400
- fromClause,
401
- groupClause,
402
- havingClause,
403
- op,
404
- sortClause,
405
- whereClause,
406
- distinctClause,
407
- limitCount,
408
- valuesLists,
409
- intoClause,
410
- all,
411
- larg,
412
- rarg,
413
- limitOffset,
414
- withClause,
415
- lockingClause,
416
- windowClause
417
- }) => {
418
- let vresult = {};
419
- vresult = jsonSet(vresult, 'targetList', targetList);
420
- vresult = jsonSet(vresult, 'fromClause', fromClause);
421
- vresult = jsonSet(vresult, 'groupClause', groupClause);
422
- vresult = jsonSet(vresult, 'havingClause', havingClause);
423
- vresult = jsonSet(vresult, 'op', op);
424
- vresult = jsonSet(vresult, 'sortClause', sortClause);
425
- vresult = jsonSet(vresult, 'whereClause', whereClause);
426
- vresult = jsonSet(vresult, 'distinctClause', distinctClause);
427
- vresult = jsonSet(vresult, 'limitCount', limitCount);
428
- vresult = jsonSet(vresult, 'valuesLists', valuesLists);
429
- vresult = jsonSet(vresult, 'intoClause', intoClause);
430
- vresult = jsonSet(vresult, 'all', all);
431
- vresult = jsonSet(vresult, 'larg', larg);
432
- vresult = jsonSet(vresult, 'rarg', rarg);
433
- vresult = jsonSet(vresult, 'limitOffset', limitOffset);
434
- vresult = jsonSet(vresult, 'withClause', withClause);
435
- vresult = jsonSet(vresult, 'lockingClause', lockingClause);
436
- vresult = jsonSet(vresult, 'windowClause', windowClause);
437
- return {
438
- SelectStmt: vresult
439
- };
440
- };
441
- export const ResTarget = ({
442
- val,
443
- name,
444
- indirection
445
- }) => {
446
- let vresult = {};
447
- vresult = jsonSet(vresult, 'val', val);
448
- vresult = jsonSet(vresult, 'name', name);
449
- vresult = jsonSet(vresult, 'indirection', indirection);
450
- return {
451
- ResTarget: vresult
452
- };
453
- };
454
- export const Alias = ({
455
- aliasname,
456
- colnames
457
- }) => {
458
- let vresult = {};
459
- vresult = jsonSet(vresult, 'aliasname', aliasname);
460
- vresult = jsonSet(vresult, 'colnames', colnames);
461
- return {
462
- Alias: vresult
463
- };
464
- };
465
- export const JoinExpr = ({
466
- jointype,
467
- larg,
468
- rarg,
469
- quals,
470
- usingClause,
471
- isNatural,
472
- alias
473
- }) => {
474
- let vresult = {};
475
- vresult = jsonSet(vresult, 'jointype', jointype);
476
- vresult = jsonSet(vresult, 'larg', larg);
477
- vresult = jsonSet(vresult, 'rarg', rarg);
478
- vresult = jsonSet(vresult, 'quals', quals);
479
- vresult = jsonSet(vresult, 'usingClause', usingClause);
480
- vresult = jsonSet(vresult, 'isNatural', isNatural);
481
- vresult = jsonSet(vresult, 'alias', alias);
482
- return {
483
- JoinExpr: vresult
484
- };
485
- };
486
- export const BoolExpr = ({
487
- boolop,
488
- args
489
- }) => {
490
- let vresult = {};
491
- vresult = jsonSet(vresult, 'boolop', boolop);
492
- vresult = jsonSet(vresult, 'args', args);
493
- return {
494
- BoolExpr: vresult
495
- };
496
- };
497
- export const A_Star = ({}) => {
498
- const vresult = {};
499
- return {
500
- A_Star: vresult
501
- };
502
- };
503
- export const SortBy = ({
504
- node,
505
- sortby_dir,
506
- sortby_nulls,
507
- useOp
508
- }) => {
509
- let vresult = {};
510
- vresult = jsonSet(vresult, 'node', node);
511
- vresult = jsonSet(vresult, 'sortby_dir', sortby_dir);
512
- vresult = jsonSet(vresult, 'sortby_nulls', sortby_nulls);
513
- vresult = jsonSet(vresult, 'useOp', useOp);
514
- return {
515
- SortBy: vresult
516
- };
517
- };
518
- export const NamedArgExpr = ({
519
- arg,
520
- name,
521
- argnumber
522
- }) => {
523
- let vresult = {};
524
- vresult = jsonSet(vresult, 'arg', arg);
525
- vresult = jsonSet(vresult, 'name', name);
526
- vresult = jsonSet(vresult, 'argnumber', argnumber);
527
- return {
528
- NamedArgExpr: vresult
529
- };
530
- };
531
- export const A_ArrayExpr = ({
532
- elements
533
- }) => {
534
- let vresult = {};
535
- vresult = jsonSet(vresult, 'elements', elements);
536
- return {
537
- A_ArrayExpr: vresult
538
- };
539
- };
540
- export const Float = ({
541
- str
542
- }) => {
543
- let vresult = {};
544
- vresult = jsonSet(vresult, 'str', str);
545
- return {
546
- Float: vresult
547
- };
548
- };
549
- export const RangeFunction = ({
550
- is_rowsfrom,
551
- functions,
552
- coldeflist,
553
- alias,
554
- lateral,
555
- ordinality
556
- }) => {
557
- let vresult = {};
558
- vresult = jsonSet(vresult, 'is_rowsfrom', is_rowsfrom);
559
- vresult = jsonSet(vresult, 'functions', functions);
560
- vresult = jsonSet(vresult, 'coldeflist', coldeflist);
561
- vresult = jsonSet(vresult, 'alias', alias);
562
- vresult = jsonSet(vresult, 'lateral', lateral);
563
- vresult = jsonSet(vresult, 'ordinality', ordinality);
564
- return {
565
- RangeFunction: vresult
566
- };
567
- };
568
- export const SubLink = ({
569
- subLinkType,
570
- subselect,
571
- testexpr,
572
- operName
573
- }) => {
574
- let vresult = {};
575
- vresult = jsonSet(vresult, 'subLinkType', subLinkType);
576
- vresult = jsonSet(vresult, 'subselect', subselect);
577
- vresult = jsonSet(vresult, 'testexpr', testexpr);
578
- vresult = jsonSet(vresult, 'operName', operName);
579
- return {
580
- SubLink: vresult
581
- };
582
- };
583
- export const Null = ({}) => {
584
- const vresult = {};
585
- return {
586
- Null: vresult
587
- };
588
- };
589
- export const VariableSetStmt = ({
590
- kind,
591
- name,
592
- args,
593
- is_local
594
- }) => {
595
- let vresult = {};
596
- vresult = jsonSet(vresult, 'kind', kind);
597
- vresult = jsonSet(vresult, 'name', name);
598
- vresult = jsonSet(vresult, 'args', args);
599
- vresult = jsonSet(vresult, 'is_local', is_local);
600
- return {
601
- VariableSetStmt: vresult
602
- };
603
- };
604
- export const VariableShowStmt = ({
605
- name
606
- }) => {
607
- let vresult = {};
608
- vresult = jsonSet(vresult, 'name', name);
609
- return {
610
- VariableShowStmt: vresult
611
- };
612
- };
613
- export const DoStmt = ({
614
- args
615
- }) => {
616
- let vresult = {};
617
- vresult = jsonSet(vresult, 'args', args);
618
- return {
619
- DoStmt: vresult
620
- };
621
- };
622
- export const CreateDomainStmt = ({
623
- domainname,
624
- typeName,
625
- constraints,
626
- collClause
627
- }) => {
628
- let vresult = {};
629
- vresult = jsonSet(vresult, 'domainname', domainname);
630
- vresult = jsonSet(vresult, 'typeName', typeName);
631
- vresult = jsonSet(vresult, 'constraints', constraints);
632
- vresult = jsonSet(vresult, 'collClause', collClause);
633
- return {
634
- CreateDomainStmt: vresult
635
- };
636
- };
637
- export const CreateEnumStmt = ({
638
- typeName,
639
- vals
640
- }) => {
641
- let vresult = {};
642
- vresult = jsonSet(vresult, 'typeName', typeName);
643
- vresult = jsonSet(vresult, 'vals', vals);
644
- return {
645
- CreateEnumStmt: vresult
646
- };
647
- };
648
- export const CreateExtensionStmt = ({
649
- extname,
650
- options,
651
- if_not_exists
652
- }) => {
653
- let vresult = {};
654
- vresult = jsonSet(vresult, 'extname', extname);
655
- vresult = jsonSet(vresult, 'options', options);
656
- vresult = jsonSet(vresult, 'if_not_exists', if_not_exists);
657
- return {
658
- CreateExtensionStmt: vresult
659
- };
660
- };
661
- export const CreateFunctionStmt = ({
662
- replace,
663
- funcname,
664
- parameters,
665
- returnType,
666
- options
667
- }) => {
668
- let vresult = {};
669
- vresult = jsonSet(vresult, 'replace', replace);
670
- vresult = jsonSet(vresult, 'funcname', funcname);
671
- vresult = jsonSet(vresult, 'parameters', parameters);
672
- vresult = jsonSet(vresult, 'returnType', returnType);
673
- vresult = jsonSet(vresult, 'options', options);
674
- return {
675
- CreateFunctionStmt: vresult
676
- };
677
- };
678
- export const FunctionParameter = ({
679
- name,
680
- argType,
681
- mode,
682
- defexpr
683
- }) => {
684
- let vresult = {};
685
- vresult = jsonSet(vresult, 'name', name);
686
- vresult = jsonSet(vresult, 'argType', argType);
687
- vresult = jsonSet(vresult, 'mode', mode);
688
- vresult = jsonSet(vresult, 'defexpr', defexpr);
689
- return {
690
- FunctionParameter: vresult
691
- };
692
- };
693
- export const TransactionStmt = ({
694
- kind,
695
- options,
696
- gid
697
- }) => {
698
- let vresult = {};
699
- vresult = jsonSet(vresult, 'kind', kind);
700
- vresult = jsonSet(vresult, 'options', options);
701
- vresult = jsonSet(vresult, 'gid', gid);
702
- return {
703
- TransactionStmt: vresult
704
- };
705
- };
706
- export const IndexStmt = ({
707
- idxname,
708
- relation,
709
- accessMethod,
710
- indexParams,
711
- concurrent,
712
- unique,
713
- whereClause,
714
- options,
715
- if_not_exists
716
- }) => {
717
- let vresult = {};
718
- vresult = jsonSet(vresult, 'idxname', idxname);
719
- vresult = jsonSet(vresult, 'relation', relation);
720
- vresult = jsonSet(vresult, 'accessMethod', accessMethod);
721
- vresult = jsonSet(vresult, 'indexParams', indexParams);
722
- vresult = jsonSet(vresult, 'concurrent', concurrent);
723
- vresult = jsonSet(vresult, 'unique', unique);
724
- vresult = jsonSet(vresult, 'whereClause', whereClause);
725
- vresult = jsonSet(vresult, 'options', options);
726
- vresult = jsonSet(vresult, 'if_not_exists', if_not_exists);
727
- return {
728
- IndexStmt: vresult
729
- };
730
- };
731
- export const IndexElem = ({
732
- name,
733
- ordering,
734
- nulls_ordering,
735
- expr,
736
- opclass,
737
- collation
738
- }) => {
739
- let vresult = {};
740
- vresult = jsonSet(vresult, 'name', name);
741
- vresult = jsonSet(vresult, 'ordering', ordering);
742
- vresult = jsonSet(vresult, 'nulls_ordering', nulls_ordering);
743
- vresult = jsonSet(vresult, 'expr', expr);
744
- vresult = jsonSet(vresult, 'opclass', opclass);
745
- vresult = jsonSet(vresult, 'collation', collation);
746
- return {
747
- IndexElem: vresult
748
- };
749
- };
750
- export const NullTest = ({
751
- arg,
752
- nulltesttype
753
- }) => {
754
- let vresult = {};
755
- vresult = jsonSet(vresult, 'arg', arg);
756
- vresult = jsonSet(vresult, 'nulltesttype', nulltesttype);
757
- return {
758
- NullTest: vresult
759
- };
760
- };
761
- export const ParamRef = ({
762
- number
763
- }) => {
764
- let vresult = {};
765
- vresult = jsonSet(vresult, 'number', number);
766
- return {
767
- ParamRef: vresult
768
- };
769
- };
770
- export const CreatePolicyStmt = ({
771
- policy_name,
772
- table,
773
- cmd_name,
774
- permissive,
775
- roles,
776
- qual,
777
- with_check
778
- }) => {
779
- let vresult = {};
780
- vresult = jsonSet(vresult, 'policy_name', policy_name);
781
- vresult = jsonSet(vresult, 'table', table);
782
- vresult = jsonSet(vresult, 'cmd_name', cmd_name);
783
- vresult = jsonSet(vresult, 'permissive', permissive);
784
- vresult = jsonSet(vresult, 'roles', roles);
785
- vresult = jsonSet(vresult, 'qual', qual);
786
- vresult = jsonSet(vresult, 'with_check', with_check);
787
- return {
788
- CreatePolicyStmt: vresult
789
- };
790
- };
791
- export const RangeSubselect = ({
792
- subquery,
793
- alias,
794
- lateral
795
- }) => {
796
- let vresult = {};
797
- vresult = jsonSet(vresult, 'subquery', subquery);
798
- vresult = jsonSet(vresult, 'alias', alias);
799
- vresult = jsonSet(vresult, 'lateral', lateral);
800
- return {
801
- RangeSubselect: vresult
802
- };
803
- };
804
- export const A_Indirection = ({
805
- arg,
806
- indirection
807
- }) => {
808
- let vresult = {};
809
- vresult = jsonSet(vresult, 'arg', arg);
810
- vresult = jsonSet(vresult, 'indirection', indirection);
811
- return {
812
- A_Indirection: vresult
813
- };
814
- };
815
- export const RowExpr = ({
816
- args,
817
- row_format
818
- }) => {
819
- let vresult = {};
820
- vresult = jsonSet(vresult, 'args', args);
821
- vresult = jsonSet(vresult, 'row_format', row_format);
822
- return {
823
- RowExpr: vresult
824
- };
825
- };
826
- export const CreateRoleStmt = ({
827
- stmt_type,
828
- role,
829
- options
830
- }) => {
831
- let vresult = {};
832
- vresult = jsonSet(vresult, 'stmt_type', stmt_type);
833
- vresult = jsonSet(vresult, 'role', role);
834
- vresult = jsonSet(vresult, 'options', options);
835
- return {
836
- CreateRoleStmt: vresult
837
- };
838
- };
839
- export const GrantRoleStmt = ({
840
- granted_roles,
841
- grantee_roles,
842
- is_grant,
843
- behavior,
844
- admin_opt
845
- }) => {
846
- let vresult = {};
847
- vresult = jsonSet(vresult, 'granted_roles', granted_roles);
848
- vresult = jsonSet(vresult, 'grantee_roles', grantee_roles);
849
- vresult = jsonSet(vresult, 'is_grant', is_grant);
850
- vresult = jsonSet(vresult, 'behavior', behavior);
851
- vresult = jsonSet(vresult, 'admin_opt', admin_opt);
852
- return {
853
- GrantRoleStmt: vresult
854
- };
855
- };
856
- export const RuleStmt = ({
857
- relation,
858
- rulename,
859
- event,
860
- instead,
861
- actions,
862
- whereClause,
863
- replace
864
- }) => {
865
- let vresult = {};
866
- vresult = jsonSet(vresult, 'relation', relation);
867
- vresult = jsonSet(vresult, 'rulename', rulename);
868
- vresult = jsonSet(vresult, 'event', event);
869
- vresult = jsonSet(vresult, 'instead', instead);
870
- vresult = jsonSet(vresult, 'actions', actions);
871
- vresult = jsonSet(vresult, 'whereClause', whereClause);
872
- vresult = jsonSet(vresult, 'replace', replace);
873
- return {
874
- RuleStmt: vresult
875
- };
876
- };
877
- export const UpdateStmt = ({
878
- relation,
879
- targetList,
880
- whereClause,
881
- returningList,
882
- fromClause,
883
- withClause
884
- }) => {
885
- let vresult = {};
886
- vresult = jsonSet(vresult, 'relation', relation);
887
- vresult = jsonSet(vresult, 'targetList', targetList);
888
- vresult = jsonSet(vresult, 'whereClause', whereClause);
889
- vresult = jsonSet(vresult, 'returningList', returningList);
890
- vresult = jsonSet(vresult, 'fromClause', fromClause);
891
- vresult = jsonSet(vresult, 'withClause', withClause);
892
- return {
893
- UpdateStmt: vresult
894
- };
895
- };
896
- export const DeleteStmt = ({
897
- relation,
898
- whereClause,
899
- usingClause,
900
- returningList,
901
- withClause
902
- }) => {
903
- let vresult = {};
904
- vresult = jsonSet(vresult, 'relation', relation);
905
- vresult = jsonSet(vresult, 'whereClause', whereClause);
906
- vresult = jsonSet(vresult, 'usingClause', usingClause);
907
- vresult = jsonSet(vresult, 'returningList', returningList);
908
- vresult = jsonSet(vresult, 'withClause', withClause);
909
- return {
910
- DeleteStmt: vresult
911
- };
912
- };
913
- export const InsertStmt = ({
914
- relation,
915
- selectStmt,
916
- override,
917
- cols,
918
- onConflictClause,
919
- returningList,
920
- withClause
921
- }) => {
922
- let vresult = {};
923
- vresult = jsonSet(vresult, 'relation', relation);
924
- vresult = jsonSet(vresult, 'selectStmt', selectStmt);
925
- vresult = jsonSet(vresult, 'override', override);
926
- vresult = jsonSet(vresult, 'cols', cols);
927
- vresult = jsonSet(vresult, 'onConflictClause', onConflictClause);
928
- vresult = jsonSet(vresult, 'returningList', returningList);
929
- vresult = jsonSet(vresult, 'withClause', withClause);
930
- return {
931
- InsertStmt: vresult
932
- };
933
- };
934
- export const CreateSeqStmt = ({
935
- sequence,
936
- options,
937
- if_not_exists
938
- }) => {
939
- let vresult = {};
940
- vresult = jsonSet(vresult, 'sequence', sequence);
941
- vresult = jsonSet(vresult, 'options', options);
942
- vresult = jsonSet(vresult, 'if_not_exists', if_not_exists);
943
- return {
944
- CreateSeqStmt: vresult
945
- };
946
- };
947
- export const OnConflictClause = ({
948
- action,
949
- infer,
950
- targetList,
951
- whereClause
952
- }) => {
953
- let vresult = {};
954
- vresult = jsonSet(vresult, 'action', action);
955
- vresult = jsonSet(vresult, 'infer', infer);
956
- vresult = jsonSet(vresult, 'targetList', targetList);
957
- vresult = jsonSet(vresult, 'whereClause', whereClause);
958
- return {
959
- OnConflictClause: vresult
960
- };
961
- };
962
- export const InferClause = ({
963
- indexElems,
964
- conname,
965
- whereClause
966
- }) => {
967
- let vresult = {};
968
- vresult = jsonSet(vresult, 'indexElems', indexElems);
969
- vresult = jsonSet(vresult, 'conname', conname);
970
- vresult = jsonSet(vresult, 'whereClause', whereClause);
971
- return {
972
- InferClause: vresult
973
- };
974
- };
975
- export const MultiAssignRef = ({
976
- source,
977
- colno,
978
- ncolumns
979
- }) => {
980
- let vresult = {};
981
- vresult = jsonSet(vresult, 'source', source);
982
- vresult = jsonSet(vresult, 'colno', colno);
983
- vresult = jsonSet(vresult, 'ncolumns', ncolumns);
984
- return {
985
- MultiAssignRef: vresult
986
- };
987
- };
988
- export const SetToDefault = ({}) => {
989
- const vresult = {};
990
- return {
991
- SetToDefault: vresult
992
- };
993
- };
994
- export const MinMaxExpr = ({
995
- op,
996
- args
997
- }) => {
998
- let vresult = {};
999
- vresult = jsonSet(vresult, 'op', op);
1000
- vresult = jsonSet(vresult, 'args', args);
1001
- return {
1002
- MinMaxExpr: vresult
1003
- };
1004
- };
1005
- export const DropStmt = ({
1006
- objects,
1007
- removeType,
1008
- behavior,
1009
- missing_ok,
1010
- concurrent
1011
- }) => {
1012
- let vresult = {};
1013
- vresult = jsonSet(vresult, 'objects', objects);
1014
- vresult = jsonSet(vresult, 'removeType', removeType);
1015
- vresult = jsonSet(vresult, 'behavior', behavior);
1016
- vresult = jsonSet(vresult, 'missing_ok', missing_ok);
1017
- vresult = jsonSet(vresult, 'concurrent', concurrent);
1018
- return {
1019
- DropStmt: vresult
1020
- };
1021
- };
1022
- export const CreateTrigStmt = ({
1023
- trigname,
1024
- relation,
1025
- funcname,
1026
- row,
1027
- timing,
1028
- events,
1029
- args,
1030
- columns,
1031
- whenClause,
1032
- transitionRels,
1033
- isconstraint,
1034
- deferrable,
1035
- initdeferred
1036
- }) => {
1037
- let vresult = {};
1038
- vresult = jsonSet(vresult, 'trigname', trigname);
1039
- vresult = jsonSet(vresult, 'relation', relation);
1040
- vresult = jsonSet(vresult, 'funcname', funcname);
1041
- vresult = jsonSet(vresult, 'row', row);
1042
- vresult = jsonSet(vresult, 'timing', timing);
1043
- vresult = jsonSet(vresult, 'events', events);
1044
- vresult = jsonSet(vresult, 'args', args);
1045
- vresult = jsonSet(vresult, 'columns', columns);
1046
- vresult = jsonSet(vresult, 'whenClause', whenClause);
1047
- vresult = jsonSet(vresult, 'transitionRels', transitionRels);
1048
- vresult = jsonSet(vresult, 'isconstraint', isconstraint);
1049
- vresult = jsonSet(vresult, 'deferrable', deferrable);
1050
- vresult = jsonSet(vresult, 'initdeferred', initdeferred);
1051
- return {
1052
- CreateTrigStmt: vresult
1053
- };
1054
- };
1055
- export const TriggerTransition = ({
1056
- name,
1057
- isNew,
1058
- isTable
1059
- }) => {
1060
- let vresult = {};
1061
- vresult = jsonSet(vresult, 'name', name);
1062
- vresult = jsonSet(vresult, 'isNew', isNew);
1063
- vresult = jsonSet(vresult, 'isTable', isTable);
1064
- return {
1065
- TriggerTransition: vresult
1066
- };
1067
- };
1068
- export const CompositeTypeStmt = ({
1069
- typevar,
1070
- coldeflist
1071
- }) => {
1072
- let vresult = {};
1073
- vresult = jsonSet(vresult, 'typevar', typevar);
1074
- vresult = jsonSet(vresult, 'coldeflist', coldeflist);
1075
- return {
1076
- CompositeTypeStmt: vresult
1077
- };
1078
- };
1079
- export const ExplainStmt = ({
1080
- query,
1081
- options
1082
- }) => {
1083
- let vresult = {};
1084
- vresult = jsonSet(vresult, 'query', query);
1085
- vresult = jsonSet(vresult, 'options', options);
1086
- return {
1087
- ExplainStmt: vresult
1088
- };
1089
- };
1090
- export const ViewStmt = ({
1091
- view,
1092
- query,
1093
- withCheckOption,
1094
- replace,
1095
- aliases,
1096
- options
1097
- }) => {
1098
- let vresult = {};
1099
- vresult = jsonSet(vresult, 'view', view);
1100
- vresult = jsonSet(vresult, 'query', query);
1101
- vresult = jsonSet(vresult, 'withCheckOption', withCheckOption);
1102
- vresult = jsonSet(vresult, 'replace', replace);
1103
- vresult = jsonSet(vresult, 'aliases', aliases);
1104
- vresult = jsonSet(vresult, 'options', options);
1105
- return {
1106
- ViewStmt: vresult
1107
- };
1108
- };
1109
- export const CollateClause = ({
1110
- arg,
1111
- collname
1112
- }) => {
1113
- let vresult = {};
1114
- vresult = jsonSet(vresult, 'arg', arg);
1115
- vresult = jsonSet(vresult, 'collname', collname);
1116
- return {
1117
- CollateClause: vresult
1118
- };
1119
- };
1120
- export const DefineStmt = ({
1121
- kind,
1122
- defnames,
1123
- args,
1124
- definition,
1125
- oldstyle
1126
- }) => {
1127
- let vresult = {};
1128
- vresult = jsonSet(vresult, 'kind', kind);
1129
- vresult = jsonSet(vresult, 'defnames', defnames);
1130
- vresult = jsonSet(vresult, 'args', args);
1131
- vresult = jsonSet(vresult, 'definition', definition);
1132
- vresult = jsonSet(vresult, 'oldstyle', oldstyle);
1133
- return {
1134
- DefineStmt: vresult
1135
- };
1136
- };
1137
- export const DropRoleStmt = ({
1138
- roles,
1139
- missing_ok
1140
- }) => {
1141
- let vresult = {};
1142
- vresult = jsonSet(vresult, 'roles', roles);
1143
- vresult = jsonSet(vresult, 'missing_ok', missing_ok);
1144
- return {
1145
- DropRoleStmt: vresult
1146
- };
1147
- };
1148
- export const AlterOwnerStmt = ({
1149
- objectType,
1150
- object,
1151
- newowner
1152
- }) => {
1153
- let vresult = {};
1154
- vresult = jsonSet(vresult, 'objectType', objectType);
1155
- vresult = jsonSet(vresult, 'object', object);
1156
- vresult = jsonSet(vresult, 'newowner', newowner);
1157
- return {
1158
- AlterOwnerStmt: vresult
1159
- };
1160
- };
1161
- export const AlterObjectSchemaStmt = ({
1162
- objectType,
1163
- object,
1164
- newschema,
1165
- relation,
1166
- missing_ok
1167
- }) => {
1168
- let vresult = {};
1169
- vresult = jsonSet(vresult, 'objectType', objectType);
1170
- vresult = jsonSet(vresult, 'object', object);
1171
- vresult = jsonSet(vresult, 'newschema', newschema);
1172
- vresult = jsonSet(vresult, 'relation', relation);
1173
- vresult = jsonSet(vresult, 'missing_ok', missing_ok);
1174
- return {
1175
- AlterObjectSchemaStmt: vresult
1176
- };
1177
- };
1178
- export const CreateConversionStmt = ({
1179
- conversion_name,
1180
- for_encoding_name,
1181
- to_encoding_name,
1182
- func_name,
1183
- def
1184
- }) => {
1185
- let vresult = {};
1186
- vresult = jsonSet(vresult, 'conversion_name', conversion_name);
1187
- vresult = jsonSet(vresult, 'for_encoding_name', for_encoding_name);
1188
- vresult = jsonSet(vresult, 'to_encoding_name', to_encoding_name);
1189
- vresult = jsonSet(vresult, 'func_name', func_name);
1190
- vresult = jsonSet(vresult, 'def', def);
1191
- return {
1192
- CreateConversionStmt: vresult
1193
- };
1194
- };
1195
- export const CreateFdwStmt = ({
1196
- fdwname,
1197
- func_options,
1198
- options
1199
- }) => {
1200
- let vresult = {};
1201
- vresult = jsonSet(vresult, 'fdwname', fdwname);
1202
- vresult = jsonSet(vresult, 'func_options', func_options);
1203
- vresult = jsonSet(vresult, 'options', options);
1204
- return {
1205
- CreateFdwStmt: vresult
1206
- };
1207
- };
1208
- export const CreateForeignServerStmt = ({
1209
- servername,
1210
- fdwname,
1211
- options,
1212
- servertype,
1213
- version
1214
- }) => {
1215
- let vresult = {};
1216
- vresult = jsonSet(vresult, 'servername', servername);
1217
- vresult = jsonSet(vresult, 'fdwname', fdwname);
1218
- vresult = jsonSet(vresult, 'options', options);
1219
- vresult = jsonSet(vresult, 'servertype', servertype);
1220
- vresult = jsonSet(vresult, 'version', version);
1221
- return {
1222
- CreateForeignServerStmt: vresult
1223
- };
1224
- };
1225
- export const CreatePLangStmt = ({
1226
- plname,
1227
- plhandler
1228
- }) => {
1229
- let vresult = {};
1230
- vresult = jsonSet(vresult, 'plname', plname);
1231
- vresult = jsonSet(vresult, 'plhandler', plhandler);
1232
- return {
1233
- CreatePLangStmt: vresult
1234
- };
1235
- };
1236
- export const CreateOpFamilyStmt = ({
1237
- opfamilyname,
1238
- amname
1239
- }) => {
1240
- let vresult = {};
1241
- vresult = jsonSet(vresult, 'opfamilyname', opfamilyname);
1242
- vresult = jsonSet(vresult, 'amname', amname);
1243
- return {
1244
- CreateOpFamilyStmt: vresult
1245
- };
1246
- };
1247
- export const CreateOpClassStmt = ({
1248
- opclassname,
1249
- amname,
1250
- datatype,
1251
- items,
1252
- isDefault
1253
- }) => {
1254
- let vresult = {};
1255
- vresult = jsonSet(vresult, 'opclassname', opclassname);
1256
- vresult = jsonSet(vresult, 'amname', amname);
1257
- vresult = jsonSet(vresult, 'datatype', datatype);
1258
- vresult = jsonSet(vresult, 'items', items);
1259
- vresult = jsonSet(vresult, 'isDefault', isDefault);
1260
- return {
1261
- CreateOpClassStmt: vresult
1262
- };
1263
- };
1264
- export const CreateOpClassItem = ({
1265
- itemtype,
1266
- storedtype,
1267
- name,
1268
- number,
1269
- class_args,
1270
- order_family
1271
- }) => {
1272
- let vresult = {};
1273
- vresult = jsonSet(vresult, 'itemtype', itemtype);
1274
- vresult = jsonSet(vresult, 'storedtype', storedtype);
1275
- vresult = jsonSet(vresult, 'name', name);
1276
- vresult = jsonSet(vresult, 'number', number);
1277
- vresult = jsonSet(vresult, 'class_args', class_args);
1278
- vresult = jsonSet(vresult, 'order_family', order_family);
1279
- return {
1280
- CreateOpClassItem: vresult
1281
- };
1282
- };
1283
- export const AlterOpFamilyStmt = ({
1284
- opfamilyname,
1285
- amname,
1286
- items,
1287
- isDrop
1288
- }) => {
1289
- let vresult = {};
1290
- vresult = jsonSet(vresult, 'opfamilyname', opfamilyname);
1291
- vresult = jsonSet(vresult, 'amname', amname);
1292
- vresult = jsonSet(vresult, 'items', items);
1293
- vresult = jsonSet(vresult, 'isDrop', isDrop);
1294
- return {
1295
- AlterOpFamilyStmt: vresult
1296
- };
1297
- };
1298
- export const AlterOperatorStmt = ({
1299
- opername,
1300
- options
1301
- }) => {
1302
- let vresult = {};
1303
- vresult = jsonSet(vresult, 'opername', opername);
1304
- vresult = jsonSet(vresult, 'options', options);
1305
- return {
1306
- AlterOperatorStmt: vresult
1307
- };
1308
- };
1309
- export const VacuumStmt = ({
1310
- options,
1311
- relation,
1312
- va_cols
1313
- }) => {
1314
- let vresult = {};
1315
- vresult = jsonSet(vresult, 'options', options);
1316
- vresult = jsonSet(vresult, 'relation', relation);
1317
- vresult = jsonSet(vresult, 'va_cols', va_cols);
1318
- return {
1319
- VacuumStmt: vresult
1320
- };
1321
- };
1322
- export const CreateTableAsStmt = ({
1323
- query,
1324
- into,
1325
- relkind,
1326
- if_not_exists
1327
- }) => {
1328
- let vresult = {};
1329
- vresult = jsonSet(vresult, 'query', query);
1330
- vresult = jsonSet(vresult, 'into', into);
1331
- vresult = jsonSet(vresult, 'relkind', relkind);
1332
- vresult = jsonSet(vresult, 'if_not_exists', if_not_exists);
1333
- return {
1334
- CreateTableAsStmt: vresult
1335
- };
1336
- };
1337
- export const IntoClause = ({
1338
- rel,
1339
- onCommit,
1340
- colNames,
1341
- skipData,
1342
- options
1343
- }) => {
1344
- let vresult = {};
1345
- vresult = jsonSet(vresult, 'rel', rel);
1346
- vresult = jsonSet(vresult, 'onCommit', onCommit);
1347
- vresult = jsonSet(vresult, 'colNames', colNames);
1348
- vresult = jsonSet(vresult, 'skipData', skipData);
1349
- vresult = jsonSet(vresult, 'options', options);
1350
- return {
1351
- IntoClause: vresult
1352
- };
1353
- };
1354
- export const CaseExpr = ({
1355
- args,
1356
- defresult,
1357
- arg
1358
- }) => {
1359
- let vresult = {};
1360
- vresult = jsonSet(vresult, 'args', args);
1361
- vresult = jsonSet(vresult, 'defresult', defresult);
1362
- vresult = jsonSet(vresult, 'arg', arg);
1363
- return {
1364
- CaseExpr: vresult
1365
- };
1366
- };
1367
- export const CaseWhen = ({
1368
- expr,
1369
- result
1370
- }) => {
1371
- let vresult = {};
1372
- vresult = jsonSet(vresult, 'expr', expr);
1373
- vresult = jsonSet(vresult, 'result', result);
1374
- return {
1375
- CaseWhen: vresult
1376
- };
1377
- };
1378
- export const BooleanTest = ({
1379
- arg,
1380
- booltesttype
1381
- }) => {
1382
- let vresult = {};
1383
- vresult = jsonSet(vresult, 'arg', arg);
1384
- vresult = jsonSet(vresult, 'booltesttype', booltesttype);
1385
- return {
1386
- BooleanTest: vresult
1387
- };
1388
- };
1389
- export const AlterFunctionStmt = ({
1390
- func,
1391
- actions
1392
- }) => {
1393
- let vresult = {};
1394
- vresult = jsonSet(vresult, 'func', func);
1395
- vresult = jsonSet(vresult, 'actions', actions);
1396
- return {
1397
- AlterFunctionStmt: vresult
1398
- };
1399
- };
1400
- export const TruncateStmt = ({
1401
- relations,
1402
- behavior,
1403
- restart_seqs
1404
- }) => {
1405
- let vresult = {};
1406
- vresult = jsonSet(vresult, 'relations', relations);
1407
- vresult = jsonSet(vresult, 'behavior', behavior);
1408
- vresult = jsonSet(vresult, 'restart_seqs', restart_seqs);
1409
- return {
1410
- TruncateStmt: vresult
1411
- };
1412
- };
1413
- export const A_Indices = ({
1414
- is_slice,
1415
- lidx,
1416
- uidx
1417
- }) => {
1418
- let vresult = {};
1419
- vresult = jsonSet(vresult, 'is_slice', is_slice);
1420
- vresult = jsonSet(vresult, 'lidx', lidx);
1421
- vresult = jsonSet(vresult, 'uidx', uidx);
1422
- return {
1423
- A_Indices: vresult
1424
- };
1425
- };
1426
- export const NotifyStmt = ({
1427
- conditionname
1428
- }) => {
1429
- let vresult = {};
1430
- vresult = jsonSet(vresult, 'conditionname', conditionname);
1431
- return {
1432
- NotifyStmt: vresult
1433
- };
1434
- };
1435
- export const ListenStmt = ({
1436
- conditionname
1437
- }) => {
1438
- let vresult = {};
1439
- vresult = jsonSet(vresult, 'conditionname', conditionname);
1440
- return {
1441
- ListenStmt: vresult
1442
- };
1443
- };
1444
- export const UnlistenStmt = ({
1445
- conditionname
1446
- }) => {
1447
- let vresult = {};
1448
- vresult = jsonSet(vresult, 'conditionname', conditionname);
1449
- return {
1450
- UnlistenStmt: vresult
1451
- };
1452
- };
1453
- export const BitString = ({
1454
- str
1455
- }) => {
1456
- let vresult = {};
1457
- vresult = jsonSet(vresult, 'str', str);
1458
- return {
1459
- BitString: vresult
1460
- };
1461
- };
1462
- export const CoalesceExpr = ({
1463
- args
1464
- }) => {
1465
- let vresult = {};
1466
- vresult = jsonSet(vresult, 'args', args);
1467
- return {
1468
- CoalesceExpr: vresult
1469
- };
1470
- };
1471
- export const ClusterStmt = ({
1472
- relation,
1473
- indexname
1474
- }) => {
1475
- let vresult = {};
1476
- vresult = jsonSet(vresult, 'relation', relation);
1477
- vresult = jsonSet(vresult, 'indexname', indexname);
1478
- return {
1479
- ClusterStmt: vresult
1480
- };
1481
- };
1482
- export const TableLikeClause = ({
1483
- relation,
1484
- options
1485
- }) => {
1486
- let vresult = {};
1487
- vresult = jsonSet(vresult, 'relation', relation);
1488
- vresult = jsonSet(vresult, 'options', options);
1489
- return {
1490
- TableLikeClause: vresult
1491
- };
1492
- };
1493
- export const WithClause = ({
1494
- ctes,
1495
- recursive
1496
- }) => {
1497
- let vresult = {};
1498
- vresult = jsonSet(vresult, 'ctes', ctes);
1499
- vresult = jsonSet(vresult, 'recursive', recursive);
1500
- return {
1501
- WithClause: vresult
1502
- };
1503
- };
1504
- export const CommonTableExpr = ({
1505
- ctename,
1506
- aliascolnames,
1507
- ctequery
1508
- }) => {
1509
- let vresult = {};
1510
- vresult = jsonSet(vresult, 'ctename', ctename);
1511
- vresult = jsonSet(vresult, 'aliascolnames', aliascolnames);
1512
- vresult = jsonSet(vresult, 'ctequery', ctequery);
1513
- return {
1514
- CommonTableExpr: vresult
1515
- };
1516
- };
1517
- export const CreateRangeStmt = ({
1518
- typeName,
1519
- params
1520
- }) => {
1521
- let vresult = {};
1522
- vresult = jsonSet(vresult, 'typeName', typeName);
1523
- vresult = jsonSet(vresult, 'params', params);
1524
- return {
1525
- CreateRangeStmt: vresult
1526
- };
1527
- };
1528
- export const DeclareCursorStmt = ({
1529
- portalname,
1530
- options,
1531
- query
1532
- }) => {
1533
- let vresult = {};
1534
- vresult = jsonSet(vresult, 'portalname', portalname);
1535
- vresult = jsonSet(vresult, 'options', options);
1536
- vresult = jsonSet(vresult, 'query', query);
1537
- return {
1538
- DeclareCursorStmt: vresult
1539
- };
1540
- };
1541
- export const FetchStmt = ({
1542
- direction,
1543
- howMany,
1544
- portalname,
1545
- ismove
1546
- }) => {
1547
- let vresult = {};
1548
- vresult = jsonSet(vresult, 'direction', direction);
1549
- vresult = jsonSet(vresult, 'howMany', howMany);
1550
- vresult = jsonSet(vresult, 'portalname', portalname);
1551
- vresult = jsonSet(vresult, 'ismove', ismove);
1552
- return {
1553
- FetchStmt: vresult
1554
- };
1555
- };
1556
- export const LockingClause = ({
1557
- strength,
1558
- waitPolicy,
1559
- lockedRels
1560
- }) => {
1561
- let vresult = {};
1562
- vresult = jsonSet(vresult, 'strength', strength);
1563
- vresult = jsonSet(vresult, 'waitPolicy', waitPolicy);
1564
- vresult = jsonSet(vresult, 'lockedRels', lockedRels);
1565
- return {
1566
- LockingClause: vresult
1567
- };
1568
- };
1569
- export const CreateAmStmt = ({
1570
- amname,
1571
- handler_name,
1572
- amtype
1573
- }) => {
1574
- let vresult = {};
1575
- vresult = jsonSet(vresult, 'amname', amname);
1576
- vresult = jsonSet(vresult, 'handler_name', handler_name);
1577
- vresult = jsonSet(vresult, 'amtype', amtype);
1578
- return {
1579
- CreateAmStmt: vresult
1580
- };
1581
- };
1582
- export const CreateCastStmt = ({
1583
- sourcetype,
1584
- targettype,
1585
- context,
1586
- inout,
1587
- func
1588
- }) => {
1589
- let vresult = {};
1590
- vresult = jsonSet(vresult, 'sourcetype', sourcetype);
1591
- vresult = jsonSet(vresult, 'targettype', targettype);
1592
- vresult = jsonSet(vresult, 'context', context);
1593
- vresult = jsonSet(vresult, 'inout', inout);
1594
- vresult = jsonSet(vresult, 'func', func);
1595
- return {
1596
- CreateCastStmt: vresult
1597
- };
1598
- };
1599
- export const ReindexStmt = ({
1600
- kind,
1601
- relation,
1602
- options,
1603
- name
1604
- }) => {
1605
- let vresult = {};
1606
- vresult = jsonSet(vresult, 'kind', kind);
1607
- vresult = jsonSet(vresult, 'relation', relation);
1608
- vresult = jsonSet(vresult, 'options', options);
1609
- vresult = jsonSet(vresult, 'name', name);
1610
- return {
1611
- ReindexStmt: vresult
1612
- };
1613
- };
1614
- export const DropOwnedStmt = ({
1615
- roles,
1616
- behavior
1617
- }) => {
1618
- let vresult = {};
1619
- vresult = jsonSet(vresult, 'roles', roles);
1620
- vresult = jsonSet(vresult, 'behavior', behavior);
1621
- return {
1622
- DropOwnedStmt: vresult
1623
- };
1624
- };
1625
- export const ReassignOwnedStmt = ({
1626
- roles,
1627
- newrole
1628
- }) => {
1629
- let vresult = {};
1630
- vresult = jsonSet(vresult, 'roles', roles);
1631
- vresult = jsonSet(vresult, 'newrole', newrole);
1632
- return {
1633
- ReassignOwnedStmt: vresult
1634
- };
1635
- };
1636
- export const AlterSeqStmt = ({
1637
- sequence,
1638
- options,
1639
- missing_ok
1640
- }) => {
1641
- let vresult = {};
1642
- vresult = jsonSet(vresult, 'sequence', sequence);
1643
- vresult = jsonSet(vresult, 'options', options);
1644
- vresult = jsonSet(vresult, 'missing_ok', missing_ok);
1645
- return {
1646
- AlterSeqStmt: vresult
1647
- };
1648
- };
1649
- export const AlterDomainStmt = ({
1650
- subtype,
1651
- typeName,
1652
- behavior,
1653
- def,
1654
- name,
1655
- missing_ok
1656
- }) => {
1657
- let vresult = {};
1658
- vresult = jsonSet(vresult, 'subtype', subtype);
1659
- vresult = jsonSet(vresult, 'typeName', typeName);
1660
- vresult = jsonSet(vresult, 'behavior', behavior);
1661
- vresult = jsonSet(vresult, 'def', def);
1662
- vresult = jsonSet(vresult, 'name', name);
1663
- vresult = jsonSet(vresult, 'missing_ok', missing_ok);
1664
- return {
1665
- AlterDomainStmt: vresult
1666
- };
1667
- };
1668
- export const PrepareStmt = ({
1669
- name,
1670
- query,
1671
- argtypes
1672
- }) => {
1673
- let vresult = {};
1674
- vresult = jsonSet(vresult, 'name', name);
1675
- vresult = jsonSet(vresult, 'query', query);
1676
- vresult = jsonSet(vresult, 'argtypes', argtypes);
1677
- return {
1678
- PrepareStmt: vresult
1679
- };
1680
- };
1681
- export const ExecuteStmt = ({
1682
- name,
1683
- params
1684
- }) => {
1685
- let vresult = {};
1686
- vresult = jsonSet(vresult, 'name', name);
1687
- vresult = jsonSet(vresult, 'params', params);
1688
- return {
1689
- ExecuteStmt: vresult
1690
- };
1691
- };
1692
- export const AlterEnumStmt = ({
1693
- typeName,
1694
- newVal,
1695
- newValIsAfter,
1696
- newValNeighbor,
1697
- skipIfNewValExists
1698
- }) => {
1699
- let vresult = {};
1700
- vresult = jsonSet(vresult, 'typeName', typeName);
1701
- vresult = jsonSet(vresult, 'newVal', newVal);
1702
- vresult = jsonSet(vresult, 'newValIsAfter', newValIsAfter);
1703
- vresult = jsonSet(vresult, 'newValNeighbor', newValNeighbor);
1704
- vresult = jsonSet(vresult, 'skipIfNewValExists', skipIfNewValExists);
1705
- return {
1706
- AlterEnumStmt: vresult
1707
- };
1708
- };
1709
- export const CreateEventTrigStmt = ({
1710
- trigname,
1711
- eventname,
1712
- funcname,
1713
- whenclause
1714
- }) => {
1715
- let vresult = {};
1716
- vresult = jsonSet(vresult, 'trigname', trigname);
1717
- vresult = jsonSet(vresult, 'eventname', eventname);
1718
- vresult = jsonSet(vresult, 'funcname', funcname);
1719
- vresult = jsonSet(vresult, 'whenclause', whenclause);
1720
- return {
1721
- CreateEventTrigStmt: vresult
1722
- };
1723
- };
1724
- export const AlterEventTrigStmt = ({
1725
- trigname,
1726
- tgenabled
1727
- }) => {
1728
- let vresult = {};
1729
- vresult = jsonSet(vresult, 'trigname', trigname);
1730
- vresult = jsonSet(vresult, 'tgenabled', tgenabled);
1731
- return {
1732
- AlterEventTrigStmt: vresult
1733
- };
1734
- };
1735
- export const CreateUserMappingStmt = ({
1736
- user,
1737
- servername,
1738
- options
1739
- }) => {
1740
- let vresult = {};
1741
- vresult = jsonSet(vresult, 'user', user);
1742
- vresult = jsonSet(vresult, 'servername', servername);
1743
- vresult = jsonSet(vresult, 'options', options);
1744
- return {
1745
- CreateUserMappingStmt: vresult
1746
- };
1747
- };
1748
- export const AlterRoleStmt = ({
1749
- role,
1750
- options,
1751
- action
1752
- }) => {
1753
- let vresult = {};
1754
- vresult = jsonSet(vresult, 'role', role);
1755
- vresult = jsonSet(vresult, 'options', options);
1756
- vresult = jsonSet(vresult, 'action', action);
1757
- return {
1758
- AlterRoleStmt: vresult
1759
- };
1760
- };
1761
- export const AlterPolicyStmt = ({
1762
- policy_name,
1763
- table,
1764
- qual
1765
- }) => {
1766
- let vresult = {};
1767
- vresult = jsonSet(vresult, 'policy_name', policy_name);
1768
- vresult = jsonSet(vresult, 'table', table);
1769
- vresult = jsonSet(vresult, 'qual', qual);
1770
- return {
1771
- AlterPolicyStmt: vresult
1772
- };
1773
- };
1774
- export const AlterFdwStmt = ({
1775
- fdwname,
1776
- func_options,
1777
- options
1778
- }) => {
1779
- let vresult = {};
1780
- vresult = jsonSet(vresult, 'fdwname', fdwname);
1781
- vresult = jsonSet(vresult, 'func_options', func_options);
1782
- vresult = jsonSet(vresult, 'options', options);
1783
- return {
1784
- AlterFdwStmt: vresult
1785
- };
1786
- };
1787
- export const AlterForeignServerStmt = ({
1788
- servername,
1789
- version,
1790
- options,
1791
- has_version
1792
- }) => {
1793
- let vresult = {};
1794
- vresult = jsonSet(vresult, 'servername', servername);
1795
- vresult = jsonSet(vresult, 'version', version);
1796
- vresult = jsonSet(vresult, 'options', options);
1797
- vresult = jsonSet(vresult, 'has_version', has_version);
1798
- return {
1799
- AlterForeignServerStmt: vresult
1800
- };
1801
- };
1802
- export const AlterUserMappingStmt = ({
1803
- user,
1804
- servername,
1805
- options
1806
- }) => {
1807
- let vresult = {};
1808
- vresult = jsonSet(vresult, 'user', user);
1809
- vresult = jsonSet(vresult, 'servername', servername);
1810
- vresult = jsonSet(vresult, 'options', options);
1811
- return {
1812
- AlterUserMappingStmt: vresult
1813
- };
1814
- };
1815
- export const DropUserMappingStmt = ({
1816
- user,
1817
- servername,
1818
- missing_ok
1819
- }) => {
1820
- let vresult = {};
1821
- vresult = jsonSet(vresult, 'user', user);
1822
- vresult = jsonSet(vresult, 'servername', servername);
1823
- vresult = jsonSet(vresult, 'missing_ok', missing_ok);
1824
- return {
1825
- DropUserMappingStmt: vresult
1826
- };
1827
- };
1828
- export const CreateForeignTableStmt = ({
1829
- base,
1830
- servername,
1831
- options
1832
- }) => {
1833
- let vresult = {};
1834
- vresult = jsonSet(vresult, 'base', base);
1835
- vresult = jsonSet(vresult, 'servername', servername);
1836
- vresult = jsonSet(vresult, 'options', options);
1837
- return {
1838
- CreateForeignTableStmt: vresult
1839
- };
1840
- };
1841
- export const ImportForeignSchemaStmt = ({
1842
- server_name,
1843
- remote_schema,
1844
- local_schema,
1845
- list_type,
1846
- table_list,
1847
- options
1848
- }) => {
1849
- let vresult = {};
1850
- vresult = jsonSet(vresult, 'server_name', server_name);
1851
- vresult = jsonSet(vresult, 'remote_schema', remote_schema);
1852
- vresult = jsonSet(vresult, 'local_schema', local_schema);
1853
- vresult = jsonSet(vresult, 'list_type', list_type);
1854
- vresult = jsonSet(vresult, 'table_list', table_list);
1855
- vresult = jsonSet(vresult, 'options', options);
1856
- return {
1857
- ImportForeignSchemaStmt: vresult
1858
- };
1859
- };
1860
- export const ConstraintsSetStmt = ({
1861
- deferred
1862
- }) => {
1863
- let vresult = {};
1864
- vresult = jsonSet(vresult, 'deferred', deferred);
1865
- return {
1866
- ConstraintsSetStmt: vresult
1867
- };
1868
- };
1869
- export const GroupingFunc = ({
1870
- args
1871
- }) => {
1872
- let vresult = {};
1873
- vresult = jsonSet(vresult, 'args', args);
1874
- return {
1875
- GroupingFunc: vresult
1876
- };
1877
- };
1878
- export const GroupingSet = ({
1879
- kind,
1880
- content
1881
- }) => {
1882
- let vresult = {};
1883
- vresult = jsonSet(vresult, 'kind', kind);
1884
- vresult = jsonSet(vresult, 'content', content);
1885
- return {
1886
- GroupingSet: vresult
1887
- };
1888
- };
1889
- export const WindowDef = ({
1890
- orderClause,
1891
- frameOptions,
1892
- partitionClause,
1893
- name,
1894
- startOffset,
1895
- endOffset
1896
- }) => {
1897
- let vresult = {};
1898
- vresult = jsonSet(vresult, 'orderClause', orderClause);
1899
- vresult = jsonSet(vresult, 'frameOptions', frameOptions);
1900
- vresult = jsonSet(vresult, 'partitionClause', partitionClause);
1901
- vresult = jsonSet(vresult, 'name', name);
1902
- vresult = jsonSet(vresult, 'startOffset', startOffset);
1903
- vresult = jsonSet(vresult, 'endOffset', endOffset);
1904
- return {
1905
- WindowDef: vresult
1906
- };
1907
- };
1908
- export const DiscardStmt = ({
1909
- target
1910
- }) => {
1911
- let vresult = {};
1912
- vresult = jsonSet(vresult, 'target', target);
1913
- return {
1914
- DiscardStmt: vresult
1915
- };
1916
- };
1917
- export const LockStmt = ({
1918
- relations,
1919
- mode,
1920
- nowait
1921
- }) => {
1922
- let vresult = {};
1923
- vresult = jsonSet(vresult, 'relations', relations);
1924
- vresult = jsonSet(vresult, 'mode', mode);
1925
- vresult = jsonSet(vresult, 'nowait', nowait);
1926
- return {
1927
- LockStmt: vresult
1928
- };
1929
- };
1930
- export const AlterRoleSetStmt = ({
1931
- role,
1932
- setstmt
1933
- }) => {
1934
- let vresult = {};
1935
- vresult = jsonSet(vresult, 'role', role);
1936
- vresult = jsonSet(vresult, 'setstmt', setstmt);
1937
- return {
1938
- AlterRoleSetStmt: vresult
1939
- };
1940
- };
1941
- export const RefreshMatViewStmt = ({
1942
- relation,
1943
- concurrent,
1944
- skipData
1945
- }) => {
1946
- let vresult = {};
1947
- vresult = jsonSet(vresult, 'relation', relation);
1948
- vresult = jsonSet(vresult, 'concurrent', concurrent);
1949
- vresult = jsonSet(vresult, 'skipData', skipData);
1950
- return {
1951
- RefreshMatViewStmt: vresult
1952
- };
1953
- };
1954
- export const CreateTransformStmt = ({
1955
- type_name,
1956
- lang,
1957
- fromsql,
1958
- tosql
1959
- }) => {
1960
- let vresult = {};
1961
- vresult = jsonSet(vresult, 'type_name', type_name);
1962
- vresult = jsonSet(vresult, 'lang', lang);
1963
- vresult = jsonSet(vresult, 'fromsql', fromsql);
1964
- vresult = jsonSet(vresult, 'tosql', tosql);
1965
- return {
1966
- CreateTransformStmt: vresult
1967
- };
1968
- };
1969
- export const ClosePortalStmt = ({
1970
- portalname
1971
- }) => {
1972
- let vresult = {};
1973
- vresult = jsonSet(vresult, 'portalname', portalname);
1974
- return {
1975
- ClosePortalStmt: vresult
1976
- };
1977
- };
1978
- export const CurrentOfExpr = ({
1979
- cursor_name
1980
- }) => {
1981
- let vresult = {};
1982
- vresult = jsonSet(vresult, 'cursor_name', cursor_name);
1983
- return {
1984
- CurrentOfExpr: vresult
1985
- };
1986
- };
1987
- export const DeallocateStmt = ({
1988
- name
1989
- }) => {
1990
- let vresult = {};
1991
- vresult = jsonSet(vresult, 'name', name);
1992
- return {
1993
- DeallocateStmt: vresult
1994
- };
1995
- };
1996
- export const ReplicaIdentityStmt = ({
1997
- identity_type,
1998
- name
1999
- }) => {
2000
- let vresult = {};
2001
- vresult = jsonSet(vresult, 'identity_type', identity_type);
2002
- vresult = jsonSet(vresult, 'name', name);
2003
- return {
2004
- ReplicaIdentityStmt: vresult
2005
- };
2006
- };
2007
- export const RangeTableSample = ({
2008
- relation,
2009
- method,
2010
- args,
2011
- repeatable
2012
- }) => {
2013
- let vresult = {};
2014
- vresult = jsonSet(vresult, 'relation', relation);
2015
- vresult = jsonSet(vresult, 'method', method);
2016
- vresult = jsonSet(vresult, 'args', args);
2017
- vresult = jsonSet(vresult, 'repeatable', repeatable);
2018
- return {
2019
- RangeTableSample: vresult
2020
- };
2021
- };
2022
- export const SecLabelStmt = ({
2023
- objtype,
2024
- object,
2025
- label,
2026
- provider
2027
- }) => {
2028
- let vresult = {};
2029
- vresult = jsonSet(vresult, 'objtype', objtype);
2030
- vresult = jsonSet(vresult, 'object', object);
2031
- vresult = jsonSet(vresult, 'label', label);
2032
- vresult = jsonSet(vresult, 'provider', provider);
2033
- return {
2034
- SecLabelStmt: vresult
2035
- };
2036
- };
2037
- export const CopyStmt = ({
2038
- query,
2039
- filename
2040
- }) => {
2041
- let vresult = {};
2042
- vresult = jsonSet(vresult, 'query', query);
2043
- vresult = jsonSet(vresult, 'filename', filename);
2044
- return {
2045
- CopyStmt: vresult
2046
- };
2047
- };
2048
- export const AlterTSConfigurationStmt = ({
2049
- kind,
2050
- cfgname,
2051
- tokentype,
2052
- dicts,
2053
- override,
2054
- replace
2055
- }) => {
2056
- let vresult = {};
2057
- vresult = jsonSet(vresult, 'kind', kind);
2058
- vresult = jsonSet(vresult, 'cfgname', cfgname);
2059
- vresult = jsonSet(vresult, 'tokentype', tokentype);
2060
- vresult = jsonSet(vresult, 'dicts', dicts);
2061
- vresult = jsonSet(vresult, 'override', override);
2062
- vresult = jsonSet(vresult, 'replace', replace);
2063
- return {
2064
- AlterTSConfigurationStmt: vresult
2065
- };
2066
- };
2067
- export const XmlExpr = ({
2068
- op,
2069
- args,
2070
- name,
2071
- xmloption,
2072
- named_args
2073
- }) => {
2074
- let vresult = {};
2075
- vresult = jsonSet(vresult, 'op', op);
2076
- vresult = jsonSet(vresult, 'args', args);
2077
- vresult = jsonSet(vresult, 'name', name);
2078
- vresult = jsonSet(vresult, 'xmloption', xmloption);
2079
- vresult = jsonSet(vresult, 'named_args', named_args);
2080
- return {
2081
- XmlExpr: vresult
2082
- };
2083
- };
2084
- export const XmlSerialize = ({
2085
- xmloption,
2086
- expr,
2087
- typeName
2088
- }) => {
2089
- let vresult = {};
2090
- vresult = jsonSet(vresult, 'xmloption', xmloption);
2091
- vresult = jsonSet(vresult, 'expr', expr);
2092
- vresult = jsonSet(vresult, 'typeName', typeName);
2093
- return {
2094
- XmlSerialize: vresult
2095
- };
2096
- };