bq2cst 0.4.25

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/bq2cst.d.ts ADDED
@@ -0,0 +1,1391 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ export function parse(code: string): UnknownNode[];
5
+ export function tokenize(code: string): Token[];
6
+
7
+ export type UnknownNode =
8
+ | AccessOperator
9
+ | AddColumnClause
10
+ | AddConstraintClause
11
+ | AlterBICapacityStatement
12
+ | AlterColumnStatement
13
+ | AlterOrganizationStatement
14
+ | AlterProjectStatement
15
+ | AlterReservationStatement
16
+ | AlterSchemaStatement
17
+ | AlterTableDropClause
18
+ | AlterTableStatement
19
+ | AlterViewStatement
20
+ | ArrayLiteral
21
+ | AssertStatement
22
+ | Asterisk
23
+ | BinaryOperator
24
+ | BeginStatement
25
+ | BetweenOperator
26
+ | BooleanLiteral
27
+ | BreakContinueStatement
28
+ | CallingFunction
29
+ | CallingTableFunction
30
+ | CallingUnnest
31
+ | CallStatement
32
+ | CaseExpr
33
+ | CaseExprArm
34
+ | CaseStatement
35
+ | CaseStatementArm
36
+ | CastArgument
37
+ | Comment
38
+ | Constraint
39
+ | CreateFunctionStatement
40
+ | CreateProcedureStatement
41
+ | CreateReservationStatement
42
+ | CreateRowAccessPolicyStatement
43
+ | CreateSchemaStatement
44
+ | CreateSearchIndexStatement
45
+ | CreateTableStatement
46
+ | CreateViewStatement
47
+ | DeclareStatement
48
+ | DeleteStatement
49
+ | DifferentialPrivacyClause
50
+ | DotOperator
51
+ | DropRowAccessPolicyStatement
52
+ | DropStatement
53
+ | ElseIfClause
54
+ | EOF
55
+ | ExecuteStatement
56
+ | ExportStatement
57
+ | ExtractArgument
58
+ | ForStatement
59
+ | ForSystemTimeAsOfClause
60
+ | GrantStatement
61
+ | GroupedExpr
62
+ | GroupedExprs
63
+ | GroupedIdentWithOptions
64
+ | GroupedStatement
65
+ | GroupedTypeDeclarationOrConstraints
66
+ | GroupedType
67
+ | Identifier
68
+ | IfStatement
69
+ | IdentWithOptions
70
+ | InOperator
71
+ | InsertStatement
72
+ | IntervalLiteral
73
+ | IsDistinctFromOperator
74
+ | JoinOperator
75
+ | Keyword
76
+ | KeywordSequence
77
+ | KeywordWithExpr
78
+ | KeywordWithExprs
79
+ | KeywordWithGroupedXXX
80
+ | KeywordWithStatement
81
+ | KeywordWithStatements
82
+ | KeywordWithType
83
+ | LimitClause
84
+ | LoadStatement
85
+ | LoopStatement
86
+ | MergeStatement
87
+ | MultiTokenIdentifier
88
+ | NullLiteral
89
+ | NumericLiteral
90
+ | OverClause
91
+ | Parameter
92
+ | PivotOperator
93
+ | PivotConfig
94
+ | RaiseStatement
95
+ | RenameColumnClause
96
+ | RepeatStatement
97
+ | RevokeStatement
98
+ | SelectStatement
99
+ | SetOperator
100
+ | SetStatement
101
+ | SingleTokenStatement
102
+ | StringLiteral
103
+ | StructLiteral
104
+ | Symbol_
105
+ | TableSampleClause
106
+ | TableSampleRatio
107
+ | Template
108
+ | TransactionStatement
109
+ | TruncateStatement
110
+ | Type
111
+ | TypeDeclaration
112
+ | UnaryOperator
113
+ | UnpivotConfig
114
+ | UnpivotOperator
115
+ | UpdateStatement
116
+ | WhenClause
117
+ | WhileStatement
118
+ | WindowClause
119
+ | WindowExpr
120
+ | WindowFrameClause
121
+ | WindowSpecification
122
+ | WithClause
123
+ | WithPartitionColumnsClause
124
+ | WithQuery
125
+ | XXXByExprs;
126
+
127
+ export type Token = {
128
+ line: number;
129
+ column: number;
130
+ literal: string;
131
+ };
132
+
133
+ interface BaseNode {
134
+ token: Token | null;
135
+ node_type: string;
136
+ children: {
137
+ leading_comments?: { NodeVec: Comment[] };
138
+ trailing_comments?: { NodeVec: Comment[] };
139
+ };
140
+ }
141
+
142
+ export type NodeChild = { Node: UnknownNode };
143
+ export type NodeVecChild = { NodeVec: UnknownNode[] };
144
+
145
+ // ----- sub types of BaseNode (abstract) -----
146
+ export type CallingFunctionGeneral = Expr & {
147
+ children: {
148
+ func: { Node: IdentifierGeneral & UnknownNode };
149
+ distinct?: NodeChild;
150
+ args?: { NodeVec: (Expr & UnknownNode | SelectStatement)[] };
151
+ ignore_nulls?: NodeVecChild;
152
+ orderby?: NodeChild;
153
+ limit?: NodeChild;
154
+ having?: NodeChild;
155
+ rparen: NodeChild;
156
+ over?: NodeChild;
157
+ };
158
+ };
159
+
160
+ export type Expr = BaseNode & {
161
+ token: Token;
162
+ children: {
163
+ as?: { Node: Keyword };
164
+ alias?: { Node: Identifier };
165
+ comma?: NodeChild;
166
+ order?: NodeChild;
167
+ null_order?: NodeVecChild;
168
+ };
169
+ };
170
+
171
+ export type FromItemExpr = Expr & {
172
+ children: {
173
+ pivot?: NodeChild;
174
+ unpivot?: NodeChild;
175
+ };
176
+ };
177
+
178
+ export type LabelableStatement = XXXStatement & {
179
+ children: {
180
+ leading_label?: NodeChild;
181
+ colon?: NodeChild;
182
+ trailing_label?: NodeChild;
183
+ };
184
+ };
185
+
186
+ export type IdentifierGeneral = FromItemExpr & {
187
+ children: {
188
+ // TABLESAMPLE SYSTEM can only be applied directly to base tables
189
+ tablesample?: NodeChild;
190
+ for_system_time_as_of?: NodeChild;
191
+ };
192
+ };
193
+
194
+ export type IdentWithOptions = Expr & {
195
+ node_type: "IdentWithOptions";
196
+ children: {
197
+ as: undefined;
198
+ alias: undefined;
199
+ order: undefined;
200
+ null_order: undefined;
201
+ options?: NodeChild;
202
+ };
203
+ };
204
+
205
+ export type XXXStatement = BaseNode & {
206
+ token: Token;
207
+ children: {
208
+ semicolon?: { Node: Symbol_ };
209
+ };
210
+ };
211
+
212
+ export type AddColumnClause = BaseNode & {
213
+ node_type: "AddColumnClause";
214
+ children: {
215
+ what: NodeChild;
216
+ if_not_exists?: NodeVecChild;
217
+ type_declaration: NodeChild;
218
+ comma?: NodeChild;
219
+ };
220
+ };
221
+
222
+ export type AddConstraintClause = BaseNode & {
223
+ node_type: "AddConstraintClause";
224
+ children: {
225
+ what?: NodeChild;
226
+ comma?: NodeChild;
227
+ };
228
+ };
229
+
230
+ // ----- sub types of BaseNode (concrete) -----
231
+ export type AlterBICapacityStatement = XXXStatement & {
232
+ node_type: "AlterBICapacityStatement";
233
+ children: {
234
+ what: NodeChild;
235
+ ident: NodeChild;
236
+ set: NodeChild;
237
+ options: NodeChild;
238
+ };
239
+ };
240
+
241
+ export type AlterColumnStatement = BaseNode & {
242
+ // NOTE this is not XXXStatement!
243
+ node_type: "AlterColumnStatement";
244
+ children: {
245
+ what: NodeChild;
246
+ if_exists?: NodeVecChild;
247
+ ident: NodeChild;
248
+ // SET
249
+ set: NodeChild;
250
+ options?: NodeChild;
251
+ data_type?: NodeVecChild;
252
+ type?: NodeChild;
253
+ default?: NodeChild;
254
+ // DROP
255
+ drop_not_null?: NodeVecChild;
256
+ drop_default?: NodeVecChild;
257
+ };
258
+ };
259
+
260
+ export type AlterOrganizationStatement = XXXStatement & {
261
+ node_type: "AlterOrganizationStatement";
262
+ children: {
263
+ what: NodeChild;
264
+ set: NodeChild;
265
+ options: NodeChild;
266
+ };
267
+ };
268
+
269
+ export type AlterProjectStatement = XXXStatement & {
270
+ node_type: "AlterProjectStatement";
271
+ children: {
272
+ what: NodeChild;
273
+ ident?: NodeChild;
274
+ set: NodeChild;
275
+ options: NodeChild;
276
+ };
277
+ };
278
+
279
+ export type AlterReservationStatement = XXXStatement & {
280
+ node_type: "AlterReservationStatement";
281
+ children: {
282
+ what: NodeChild;
283
+ ident: NodeChild;
284
+ set: NodeChild;
285
+ options: NodeChild;
286
+ };
287
+ };
288
+
289
+ export type AlterSchemaStatement = XXXStatement & {
290
+ node_type: "AlterSchemaStatement";
291
+ children: {
292
+ what: NodeChild;
293
+ if_exists?: NodeVecChild;
294
+ ident: NodeChild;
295
+ set: NodeChild;
296
+ default_collate?: NodeChild;
297
+ options?: NodeChild;
298
+ };
299
+ };
300
+
301
+ export type AlterTableDropClause = BaseNode & {
302
+ node_type: "AlterTableDropClause";
303
+ children: {
304
+ what: NodeChild;
305
+ if_exists?: NodeVecChild;
306
+ ident?: NodeChild;
307
+ comma?: NodeChild;
308
+ };
309
+ };
310
+
311
+ export type AlterTableStatement = XXXStatement & {
312
+ node_type: "AlterTableStatement";
313
+ children: {
314
+ what: NodeChild;
315
+ if_exists?: NodeVecChild;
316
+ ident: NodeChild;
317
+ // SET
318
+ set?: NodeChild;
319
+ options?: NodeChild;
320
+ default_collate?: NodeChild;
321
+ // ADD COLUMN
322
+ add_columns?: NodeVecChild;
323
+ // ADD CONSTRAINT
324
+ add_constraints?: NodeVecChild;
325
+ // RENAME TO
326
+ rename?: NodeChild;
327
+ to?: NodeChild;
328
+ // RENAME COLUMN
329
+ rename_columns?: NodeVecChild;
330
+ // DROP COLUMN
331
+ drop_columns?: NodeVecChild;
332
+ // ALTER COLUMN statement
333
+ alter_column_stmt?: NodeChild;
334
+ };
335
+ };
336
+
337
+ export type AlterViewStatement = XXXStatement & {
338
+ node_type: "AlterViewStatement";
339
+ children: {
340
+ materialized?: NodeChild;
341
+ what: NodeChild;
342
+ if_exists?: NodeVecChild;
343
+ ident: NodeChild;
344
+ // SET
345
+ set?: NodeChild;
346
+ options?: NodeChild;
347
+ // ALTER COLUMN statement
348
+ alter_column_stmt?: NodeChild;
349
+ };
350
+ };
351
+
352
+ export type AccessOperator = Expr & {
353
+ node_type: "AccessOperator";
354
+ children: {
355
+ not: undefined;
356
+ left: NodeChild;
357
+ right: NodeChild;
358
+ rparen: NodeChild;
359
+ };
360
+ };
361
+
362
+ export type ArrayLiteral = Expr & {
363
+ node_type: "ArrayLiteral";
364
+ children: {
365
+ type?: NodeChild;
366
+ exprs: NodeVecChild;
367
+ rparen: NodeChild;
368
+ };
369
+ };
370
+
371
+ export type AssertStatement = XXXStatement & {
372
+ node_type: "AssertStatement";
373
+ children: {
374
+ expr: NodeChild;
375
+ as: NodeChild;
376
+ description: NodeChild;
377
+ };
378
+ };
379
+
380
+ export type Asterisk = Expr & {
381
+ node_type: "Asterisk";
382
+ children: {
383
+ except?: NodeChild;
384
+ replace?: NodeChild;
385
+ order: undefined;
386
+ null_order: undefined;
387
+ };
388
+ };
389
+
390
+ export type BinaryOperator = Expr & {
391
+ node_type: "BinaryOperator";
392
+ children: {
393
+ not?: NodeChild;
394
+ left: { Node: Expr & UnknownNode };
395
+ right: { Node: Expr & UnknownNode };
396
+ };
397
+ };
398
+
399
+ export type BeginStatement = LabelableStatement & {
400
+ node_type: "BeginStatement";
401
+ children: {
402
+ stmts?: NodeVecChild;
403
+ exception_when_error?: NodeVecChild;
404
+ then?: NodeChild;
405
+ end: NodeChild;
406
+ };
407
+ };
408
+
409
+ export type BetweenOperator = Expr & {
410
+ node_type: "BetweenOperator";
411
+ children: {
412
+ left: NodeChild;
413
+ not?: NodeChild;
414
+ right_min: NodeChild;
415
+ right_max: NodeChild;
416
+ and: NodeChild;
417
+ };
418
+ };
419
+
420
+ export type BooleanLiteral = Expr & {
421
+ node_type: "BooleanLiteral";
422
+ };
423
+
424
+ export type BreakContinueStatement = XXXStatement & {
425
+ node_type: "BreakContinueStatement";
426
+ children: {
427
+ label?: NodeChild;
428
+ };
429
+ };
430
+
431
+ export type CallingFunction = CallingFunctionGeneral & {
432
+ node_type: "CallingFunction";
433
+ };
434
+
435
+ export type CallingTableFunction = FromItemExpr &
436
+ CallingFunctionGeneral & {
437
+ node_type: "CallingTableFunction";
438
+ children: {
439
+ distinct: undefined;
440
+ ignore_nulls: undefined;
441
+ orderby: undefined;
442
+ limit: undefined;
443
+ having: undefined;
444
+ over: undefined;
445
+ comma: undefined;
446
+ order: undefined;
447
+ null_order: undefined;
448
+ };
449
+ };
450
+
451
+ export type CallingUnnest = FromItemExpr &
452
+ CallingFunctionGeneral & {
453
+ node_type: "CallingUnnest";
454
+ children: {
455
+ with_offset: NodeChild;
456
+ offset_alias: NodeChild;
457
+ offset_as: NodeChild;
458
+ distinct: undefined;
459
+ ignore_nulls: undefined;
460
+ orderby: undefined;
461
+ limit: undefined;
462
+ having: undefined;
463
+ over: undefined;
464
+ order: undefined;
465
+ null_order: undefined;
466
+ comma: undefined;
467
+ };
468
+ };
469
+
470
+ export type CallStatement = XXXStatement & {
471
+ node_type: "CallStatement";
472
+ children: {
473
+ procedure: NodeChild;
474
+ };
475
+ };
476
+
477
+ export type CaseExpr = Expr & {
478
+ node_type: "CaseExpr";
479
+ children: {
480
+ expr?: NodeChild;
481
+ arms: NodeVecChild;
482
+ end: NodeChild;
483
+ };
484
+ };
485
+
486
+ export type CaseExprArm = BaseNode & {
487
+ node_type: "CaseExprArm";
488
+ children: {
489
+ expr?: NodeChild;
490
+ then?: NodeChild;
491
+ result: NodeChild;
492
+ };
493
+ };
494
+
495
+ export type CaseStatement = XXXStatement & {
496
+ node_type: "CaseStatement";
497
+ children: {
498
+ expr?: NodeChild;
499
+ arms: NodeVecChild;
500
+ end_case: NodeVecChild;
501
+ };
502
+ };
503
+
504
+ export type CaseStatementArm = BaseNode & {
505
+ node_type: "CaseStatementArm";
506
+ children: {
507
+ expr?: NodeChild;
508
+ then?: NodeChild;
509
+ stmts: NodeVecChild;
510
+ };
511
+ };
512
+
513
+ export type CastArgument = BaseNode & {
514
+ token: Token;
515
+ node_type: "CastArgument";
516
+ children: {
517
+ cast_from: NodeChild;
518
+ cast_to: NodeChild;
519
+ format?: NodeChild;
520
+ };
521
+ };
522
+
523
+ export type Comment = BaseNode & {
524
+ token: Token;
525
+ node_type: "Comment";
526
+ children: {
527
+ leading_comments: undefined;
528
+ trailing_comments: undefined;
529
+ };
530
+ };
531
+
532
+ export type Constraint = BaseNode & {
533
+ token: Token;
534
+ node_type: "Constraint";
535
+ children: {
536
+ constraint?: NodeChild;
537
+ ident?: NodeChild;
538
+ if_not_exists?: NodeVecChild;
539
+ key: NodeChild;
540
+ columns?: NodeChild;
541
+ references?: NodeChild;
542
+ enforced?: NodeChild;
543
+ comma?: NodeChild;
544
+ };
545
+ };
546
+
547
+ export type CreateFunctionStatement = XXXStatement & {
548
+ node_type: "CreateFunctionStatement";
549
+ children: {
550
+ or_replace?: NodeVecChild;
551
+ temp?: NodeChild;
552
+ table?: NodeChild;
553
+ what: NodeChild;
554
+ if_not_exists?: NodeVecChild;
555
+ ident: NodeChild;
556
+ group: NodeChild;
557
+ returns?: NodeChild;
558
+ remote?: NodeChild;
559
+ determinism?: NodeVecChild;
560
+ language?: NodeChild;
561
+ options?: NodeChild;
562
+ as?: NodeChild;
563
+ };
564
+ };
565
+
566
+ export type CreateProcedureStatement = XXXStatement & {
567
+ node_type: "CreateProcedureStatement";
568
+ children: {
569
+ or_replace?: NodeVecChild;
570
+ what: NodeChild;
571
+ if_not_exists?: NodeVecChild;
572
+ ident: NodeChild;
573
+ group: NodeChild;
574
+ with_connection?: NodeChild;
575
+ options?: NodeChild;
576
+ language?: NodeChild;
577
+ stmt?: NodeChild;
578
+ as?: NodeChild;
579
+ };
580
+ };
581
+
582
+ export type CreateReservationStatement = XXXStatement & {
583
+ node_type: "CreateReservationStatement";
584
+ children: {
585
+ what: NodeChild;
586
+ ident: NodeChild;
587
+ as?: NodeChild;
588
+ json?: NodeChild;
589
+ json_string?: NodeChild;
590
+ options?: NodeChild;
591
+ };
592
+ };
593
+
594
+ export type CreateRowAccessPolicyStatement = XXXStatement & {
595
+ node_type: "CreateRowAccessPolicyStatement";
596
+ children: {
597
+ or_replace?: NodeVecChild;
598
+ what: NodeVecChild;
599
+ if_not_exists?: NodeVecChild;
600
+ ident: NodeChild;
601
+ on: NodeChild;
602
+ grant?: NodeChild;
603
+ to?: NodeChild;
604
+ filter: NodeChild;
605
+ using: NodeChild;
606
+ };
607
+ };
608
+
609
+ export type CreateSchemaStatement = XXXStatement & {
610
+ node_type: "CreateSchemaStatement";
611
+ children: {
612
+ what: NodeChild;
613
+ if_not_exists?: NodeVecChild;
614
+ ident: NodeChild;
615
+ default_collate: NodeChild;
616
+ options?: NodeChild;
617
+ };
618
+ };
619
+
620
+ export type CreateSearchIndexStatement = XXXStatement & {
621
+ node_type: "CreateSearchIndexStatement";
622
+ children: {
623
+ what: NodeChild;
624
+ if_not_exists?: NodeVecChild;
625
+ ident: NodeChild;
626
+ on: NodeChild;
627
+ tablename: NodeChild;
628
+ column_group: NodeChild;
629
+ options?: NodeChild;
630
+ };
631
+ };
632
+
633
+ export type CreateTableStatement = XXXStatement & {
634
+ node_type: "CreateTableStatement";
635
+ children: {
636
+ or_replace?: NodeVecChild;
637
+ temp?: NodeChild;
638
+ external?: NodeChild;
639
+ snapshot?: NodeChild;
640
+ what: NodeChild;
641
+ if_not_exists?: NodeVecChild;
642
+ ident: NodeChild;
643
+ like_or_copy: NodeChild;
644
+ source_table: NodeChild;
645
+ column_schema_group?: NodeChild;
646
+ default_collate?: NodeChild;
647
+ clone?: NodeChild;
648
+ partitionby?: NodeChild;
649
+ clusterby?: NodeChild;
650
+ with_connection?: NodeChild;
651
+ with_partition_columns?: NodeChild;
652
+ options?: NodeChild;
653
+ as?: NodeChild;
654
+ };
655
+ };
656
+
657
+ export type CreateViewStatement = XXXStatement & {
658
+ node_type: "CreateViewStatement";
659
+ children: {
660
+ or_replace?: NodeVecChild;
661
+ materialized?: NodeChild;
662
+ what: NodeChild;
663
+ if_not_exists?: NodeVecChild;
664
+ ident: NodeChild;
665
+ column_name_list?: NodeChild;
666
+ partitionby?: NodeChild;
667
+ clusterby?: NodeChild;
668
+ options?: NodeChild;
669
+ as: NodeChild;
670
+ };
671
+ };
672
+
673
+ export type DeclareStatement = XXXStatement & {
674
+ node_type: "DeclareStatement";
675
+ children: {
676
+ idents: NodeVecChild;
677
+ variable_type?: NodeChild;
678
+ default?: NodeChild;
679
+ };
680
+ };
681
+
682
+ export type DeleteStatement = XXXStatement & {
683
+ node_type: "DeleteStatement";
684
+ children: {
685
+ from: NodeChild;
686
+ table_name: NodeChild;
687
+ where: NodeChild;
688
+ };
689
+ };
690
+
691
+ export type DifferentialPrivacyClause = BaseNode & {
692
+ token: Token;
693
+ node_type: "DifferentialPrivacyClause";
694
+ children: {
695
+ differential_privacy: NodeChild;
696
+ options?: NodeChild;
697
+ };
698
+ };
699
+
700
+ export type DotOperator = IdentifierGeneral & {
701
+ node_type: "DotOperator";
702
+ children: {
703
+ left: { Node: IdentifierGeneral & UnknownNode };
704
+ right: { Node: IdentifierGeneral & UnknownNode };
705
+ };
706
+ };
707
+
708
+ export type DropRowAccessPolicyStatement = XXXStatement & {
709
+ node_type: "DropRowAccessPolicyStatement";
710
+ children: {
711
+ what: NodeVecChild;
712
+ if_exists?: NodeVecChild;
713
+ ident?: NodeChild;
714
+ on: NodeChild;
715
+ };
716
+ };
717
+
718
+ export type DropStatement = XXXStatement & {
719
+ node_type: "DropStatement";
720
+ children: {
721
+ external?: NodeChild;
722
+ materialized?: NodeChild;
723
+ table?: NodeChild;
724
+ what: NodeChild;
725
+ if_exists?: NodeVecChild;
726
+ ident: NodeChild;
727
+ on?: NodeChild;
728
+ cascade_or_restrict?: NodeChild;
729
+ };
730
+ };
731
+
732
+ export type ElseIfClause = BaseNode & {
733
+ token: Token;
734
+ node_type: "ElseIfClause";
735
+ children: {
736
+ condition: NodeChild;
737
+ then: NodeChild;
738
+ };
739
+ };
740
+
741
+ export type EOF = BaseNode & {
742
+ token: null;
743
+ node_type: "EOF";
744
+ children: {
745
+ trailing_comments: undefined;
746
+ };
747
+ };
748
+
749
+ export type ExecuteStatement = XXXStatement & {
750
+ node_type: "ExecuteStatement";
751
+ children: {
752
+ immediate: NodeChild;
753
+ sql_expr: NodeChild;
754
+ into: NodeChild;
755
+ using?: NodeChild;
756
+ };
757
+ };
758
+
759
+ export type ExportStatement = XXXStatement & {
760
+ node_type: "ExportStatement";
761
+ children: {
762
+ data: NodeChild;
763
+ options: NodeChild;
764
+ as: NodeChild;
765
+ };
766
+ };
767
+
768
+ export type ExtractArgument = BaseNode & {
769
+ token: Token;
770
+ node_type: "ExtractArgument";
771
+ children: {
772
+ extract_datepart: NodeChild;
773
+ extract_from: NodeChild;
774
+ at_time_zone: NodeVecChild;
775
+ time_zone: NodeChild;
776
+ };
777
+ };
778
+
779
+ export type ForStatement = LabelableStatement & {
780
+ node_type: "ForStatement";
781
+ children: {
782
+ ident: NodeChild;
783
+ in: NodeChild;
784
+ do: NodeChild;
785
+ end_for: NodeVecChild;
786
+ };
787
+ };
788
+
789
+ export type ForSystemTimeAsOfClause = BaseNode & {
790
+ token: Token;
791
+ node_type: "ForSystemTimeAsOfClause";
792
+ children: {
793
+ system_time_as_of: NodeVecChild;
794
+ expr: NodeChild;
795
+ };
796
+ };
797
+
798
+ export type GrantStatement = XXXStatement & {
799
+ node_type: "GrantStatement";
800
+ children: {
801
+ roles: NodeVecChild;
802
+ on: NodeChild;
803
+ resource_type: NodeChild;
804
+ ident: NodeChild;
805
+ to: NodeChild;
806
+ };
807
+ };
808
+
809
+ export type GroupedExpr = FromItemExpr & {
810
+ node_type: "GroupedExpr";
811
+ children: {
812
+ expr: NodeChild;
813
+ rparen: NodeChild;
814
+ };
815
+ };
816
+
817
+ export type GroupedExprs = BaseNode & {
818
+ token: Token;
819
+ node_type: "GroupedExprs";
820
+ children: {
821
+ exprs?: NodeVecChild;
822
+ rparen: NodeChild;
823
+ // only in UNPIVOT operator
824
+ as?: NodeChild;
825
+ row_value_alias?: NodeChild;
826
+ // only in INSERT statement
827
+ comma?: NodeChild;
828
+ };
829
+ };
830
+
831
+ export type GroupedIdentWithOptions = BaseNode & {
832
+ token: Token;
833
+ node_type: "GroupedIdentWithOptions";
834
+ children: {
835
+ idents: NodeVecChild;
836
+ rparen: NodeChild;
837
+ };
838
+ };
839
+
840
+ export type GroupedStatement = FromItemExpr &
841
+ XXXStatement & {
842
+ node_type: "GroupedStatement";
843
+ children: {
844
+ with?: { Node: WithClause };
845
+ stmt: NodeChild;
846
+ rparen: NodeChild;
847
+ orderby: NodeChild;
848
+ limit: NodeChild;
849
+ };
850
+ };
851
+
852
+ export type GroupedTypeDeclarationOrConstraints = BaseNode & {
853
+ node_type: "GroupedTypeDeclarationOrConstraints";
854
+ children: {
855
+ declarations: NodeVecChild;
856
+ rparen: NodeChild;
857
+ };
858
+ };
859
+
860
+ export type GroupedType = BaseNode & {
861
+ node_type: "GroupedType";
862
+ children: {
863
+ type: NodeChild;
864
+ rparen: NodeChild;
865
+ };
866
+ };
867
+
868
+ export type Identifier = IdentifierGeneral & {
869
+ node_type: "Identifier";
870
+ };
871
+
872
+ export type IfStatement = XXXStatement & {
873
+ node_type: "IfStatement";
874
+ children: {
875
+ condition: NodeChild;
876
+ then: NodeChild;
877
+ elseifs: NodeVecChild;
878
+ else: NodeChild;
879
+ end_if: NodeVecChild;
880
+ };
881
+ };
882
+
883
+ export type InOperator = Expr & {
884
+ node_type: "InOperator";
885
+ children: {
886
+ not?: NodeChild;
887
+ left: NodeChild;
888
+ right: NodeChild;
889
+ };
890
+ };
891
+
892
+ export type InsertStatement = XXXStatement & {
893
+ node_type: "InsertStatement";
894
+ children: {
895
+ into?: NodeChild;
896
+ target_name?: NodeChild;
897
+ columns?: NodeChild;
898
+ input: NodeChild;
899
+ };
900
+ };
901
+
902
+ export type IntervalLiteral = Expr & {
903
+ node_type: "IntervalLiteral";
904
+ children: {
905
+ expr: NodeChild;
906
+ date_part: NodeChild;
907
+ to?: NodeChild;
908
+ to_date_part?: NodeChild;
909
+ order: undefined;
910
+ null_order: undefined;
911
+ };
912
+ };
913
+
914
+ export type IsDistinctFromOperator = Expr & {
915
+ node_type: "IsDistinctFromOperator";
916
+ children: {
917
+ not?: NodeChild;
918
+ distinct: NodeChild;
919
+ from: NodeChild;
920
+ left: NodeChild;
921
+ right: NodeChild;
922
+ };
923
+ };
924
+
925
+ export type JoinOperator = FromItemExpr & {
926
+ node_type: "JoinOperator";
927
+ children: {
928
+ join_type: NodeChild;
929
+ outer: NodeChild;
930
+ left: NodeChild;
931
+ right: NodeChild;
932
+ on: NodeChild;
933
+ using: NodeChild;
934
+ order: undefined;
935
+ null_order: undefined;
936
+ comma: undefined;
937
+ };
938
+ };
939
+
940
+ export type Keyword = BaseNode & {
941
+ token: Token;
942
+ node_type: "Keyword";
943
+ };
944
+
945
+ export type KeywordSequence = BaseNode & {
946
+ node_type: "KeywordSequence";
947
+ children: {
948
+ next_keyword: { Node: Keyword | KeywordSequence | KeywordWithExpr };
949
+ };
950
+ };
951
+
952
+ export type KeywordWithExpr = BaseNode & {
953
+ node_type: "KeywordWithExpr";
954
+ children: {
955
+ expr: NodeChild;
956
+ };
957
+ };
958
+
959
+ export type KeywordWithExprs = BaseNode & {
960
+ node_type: "KeywordWithExprs";
961
+ children: {
962
+ exprs: NodeVecChild;
963
+ };
964
+ };
965
+
966
+ export type KeywordWithGroupedXXX = BaseNode & {
967
+ node_type: "KeywordWithGroupedXXX";
968
+ children: {
969
+ group: NodeChild;
970
+ };
971
+ };
972
+
973
+ export type KeywordWithStatement = BaseNode & {
974
+ node_type: "KeywordWithStatement";
975
+ children: {
976
+ stmt: NodeChild;
977
+ };
978
+ };
979
+
980
+ export type KeywordWithStatements = BaseNode & {
981
+ node_type: "KeywordWithStatements";
982
+ children: {
983
+ stmts: NodeVecChild;
984
+ };
985
+ };
986
+
987
+ export type KeywordWithType = BaseNode & {
988
+ node_type: "KeywordWithType";
989
+ children: {
990
+ type: NodeChild;
991
+ };
992
+ };
993
+
994
+ export type LimitClause = BaseNode & {
995
+ node_type: "LimitClause";
996
+ children: {
997
+ expr: NodeChild;
998
+ offset?: NodeChild;
999
+ };
1000
+ };
1001
+
1002
+ export type LoopStatement = LabelableStatement & {
1003
+ node_type: "LoopStatement";
1004
+ children: {
1005
+ stmts?: NodeVecChild;
1006
+ end_loop: NodeVecChild;
1007
+ };
1008
+ };
1009
+
1010
+ export type LoadStatement = XXXStatement & {
1011
+ node_type: "LoadStatement";
1012
+ children: {
1013
+ data: NodeChild;
1014
+ into: NodeChild;
1015
+ ident: NodeChild;
1016
+ column_group?: NodeChild;
1017
+ partitionby?: NodeChild;
1018
+ clusterby?: NodeChild;
1019
+ options?: NodeChild;
1020
+ from: NodeChild;
1021
+ files: NodeChild;
1022
+ from_files: NodeChild;
1023
+ with_partition_columns?: NodeChild;
1024
+ with?: NodeChild;
1025
+ connection?: NodeChild;
1026
+ connection_name?: NodeChild;
1027
+ };
1028
+ };
1029
+
1030
+ export type MergeStatement = XXXStatement & {
1031
+ node_type: "MergeStatement";
1032
+ children: {
1033
+ into?: NodeChild;
1034
+ table_name: NodeChild;
1035
+ using: NodeChild;
1036
+ on: NodeChild;
1037
+ whens: NodeVecChild;
1038
+ };
1039
+ };
1040
+
1041
+ export type MultiTokenIdentifier = IdentifierGeneral & {
1042
+ node_type: "MultiTokenIdentifier";
1043
+ children: {
1044
+ trailing_idents: { NodeVec: (IdentifierGeneral & UnknownNode)[] };
1045
+ };
1046
+ };
1047
+
1048
+ export type NullLiteral = Expr & {
1049
+ node_type: "NullLiteral";
1050
+ };
1051
+
1052
+ export type NumericLiteral = Expr & {
1053
+ node_type: "NumericLiteral";
1054
+ };
1055
+
1056
+ export type OverClause = BaseNode & {
1057
+ token: Token;
1058
+ node_type: "OverClause";
1059
+ children: {
1060
+ window: NodeChild;
1061
+ };
1062
+ };
1063
+
1064
+ export type Parameter = IdentifierGeneral & {
1065
+ node_type: "Parameter";
1066
+ };
1067
+
1068
+ export type PivotOperator = BaseNode & {
1069
+ token: Token;
1070
+ node_type: "PivotOperator";
1071
+ children: {
1072
+ config: NodeChild;
1073
+ as?: NodeChild;
1074
+ alias?: NodeChild;
1075
+ };
1076
+ };
1077
+
1078
+ export type PivotConfig = BaseNode & {
1079
+ token: Token;
1080
+ node_type: "PivotConfig";
1081
+ children: {
1082
+ exprs: NodeVecChild;
1083
+ for: NodeChild;
1084
+ in: NodeChild;
1085
+ rparen: NodeChild;
1086
+ };
1087
+ };
1088
+
1089
+ export type RaiseStatement = XXXStatement & {
1090
+ node_type: "RaiseStatement";
1091
+ children: {
1092
+ using?: NodeChild;
1093
+ };
1094
+ };
1095
+
1096
+ export type RenameColumnClause = BaseNode & {
1097
+ token: Token;
1098
+ node_type: "RenameColumnClause";
1099
+ children: {
1100
+ column: NodeChild;
1101
+ if_exists?: NodeChild;
1102
+ ident: NodeChild;
1103
+ to: NodeChild;
1104
+ comma?: NodeChild;
1105
+ };
1106
+ };
1107
+
1108
+ export type RepeatStatement = LabelableStatement & {
1109
+ node_type: "RepeatStatement";
1110
+ children: {
1111
+ stmts: NodeVecChild;
1112
+ until: NodeChild;
1113
+ end_repeat: NodeVecChild;
1114
+ };
1115
+ };
1116
+
1117
+ export type RevokeStatement = XXXStatement & {
1118
+ node_type: "RevokeStatement";
1119
+ children: {
1120
+ roles: NodeVecChild;
1121
+ on: NodeChild;
1122
+ resource_type: NodeChild;
1123
+ ident: NodeChild;
1124
+ from: NodeChild;
1125
+ };
1126
+ };
1127
+
1128
+ export type SelectStatement = XXXStatement & {
1129
+ token: Token;
1130
+ node_type: "SelectStatement";
1131
+ children: {
1132
+ with?: { Node: WithClause };
1133
+ differential_privacy?: NodeChild;
1134
+ as_struct_or_value?: NodeVecChild;
1135
+ distinct_or_all?: NodeChild;
1136
+ exprs: NodeVecChild;
1137
+ from?: NodeChild;
1138
+ where?: NodeChild;
1139
+ groupby?: NodeChild;
1140
+ having?: NodeChild;
1141
+ qualify?: NodeChild;
1142
+ window?: NodeChild;
1143
+ orderby?: NodeChild;
1144
+ limit?: NodeChild;
1145
+ };
1146
+ };
1147
+
1148
+ export type SetOperator = XXXStatement & {
1149
+ node_type: "SetOperator";
1150
+ children: {
1151
+ with?: { Node: WithClause };
1152
+ distinct_or_all: NodeChild;
1153
+ left: { Node: SetOperator | SelectStatement | GroupedStatement };
1154
+ right: { Node: SetOperator | SelectStatement | GroupedStatement };
1155
+ };
1156
+ };
1157
+
1158
+ export type SetStatement = XXXStatement & {
1159
+ node_type: "SetStatement";
1160
+ children: {
1161
+ expr: NodeChild;
1162
+ };
1163
+ };
1164
+
1165
+ export type SingleTokenStatement = XXXStatement & {
1166
+ node_type: "SingleTokenStatement";
1167
+ };
1168
+
1169
+ export type StringLiteral = Expr & {
1170
+ node_type: "StringLiteral";
1171
+ };
1172
+
1173
+ export type StructLiteral = Expr & {
1174
+ node_type: "StructLiteral";
1175
+ children: {
1176
+ type?: NodeChild;
1177
+ exprs: NodeVecChild;
1178
+ rparen: NodeChild;
1179
+ };
1180
+ };
1181
+
1182
+ export type Symbol_ = BaseNode & {
1183
+ token: Token;
1184
+ node_type: "Symbol";
1185
+ };
1186
+
1187
+ export type TableSampleClause = BaseNode & {
1188
+ token: Token;
1189
+ node_type: "TableSampleClause";
1190
+ children: {
1191
+ system: NodeChild;
1192
+ group: NodeChild;
1193
+ };
1194
+ };
1195
+
1196
+ export type TableSampleRatio = BaseNode & {
1197
+ token: Token;
1198
+ node_type: "TableSampleRatio";
1199
+ children: {
1200
+ expr: NodeChild;
1201
+ percent: NodeChild;
1202
+ rparen: NodeChild;
1203
+ };
1204
+ };
1205
+
1206
+ export type Template = IdentifierGeneral & {
1207
+ node_type: "Template";
1208
+ };
1209
+
1210
+ export type TransactionStatement = XXXStatement & {
1211
+ node_type: "TransactionStatement";
1212
+ children: {
1213
+ transaction?: NodeChild;
1214
+ };
1215
+ };
1216
+
1217
+ export type TruncateStatement = XXXStatement & {
1218
+ node_type: "TruncateStatement";
1219
+ children: {
1220
+ table: NodeChild;
1221
+ table_name: NodeChild;
1222
+ };
1223
+ };
1224
+
1225
+ export type Type = BaseNode & {
1226
+ token: Token;
1227
+ node_type: "Type";
1228
+ children: {
1229
+ type?: NodeChild; // ANY TYPE
1230
+ type_declaration?: NodeChild;
1231
+ parameter?: NodeChild;
1232
+ not_null?: NodeVecChild;
1233
+ constraint?: NodeChild;
1234
+ primarykey?: NodeChild;
1235
+ references?: NodeChild;
1236
+ enforced?: NodeChild;
1237
+ default?: NodeChild;
1238
+ options?: NodeChild;
1239
+ collate?: NodeChild
1240
+ };
1241
+ };
1242
+
1243
+ export type TypeDeclaration = BaseNode & {
1244
+ token: Token;
1245
+ node_type: "TypeDeclaration";
1246
+ children: {
1247
+ in_out: NodeChild;
1248
+ type: NodeChild;
1249
+ comma?: NodeChild;
1250
+ };
1251
+ };
1252
+
1253
+ export type UnaryOperator = Expr & {
1254
+ token: Token;
1255
+ node_type: "UnaryOperator";
1256
+ children: {
1257
+ right: NodeChild;
1258
+ };
1259
+ };
1260
+
1261
+ export type UnpivotConfig = BaseNode & {
1262
+ token: Token;
1263
+ node_type: "UnpivotConfig";
1264
+ children: {
1265
+ expr: NodeChild;
1266
+ for: NodeChild;
1267
+ in: NodeChild;
1268
+ rparen: NodeChild;
1269
+ };
1270
+ };
1271
+
1272
+ export type UnpivotOperator = BaseNode & {
1273
+ token: Token;
1274
+ node_type: "UnpivotOperator";
1275
+ children: {
1276
+ include_or_exclude_nulls: NodeVecChild;
1277
+ config: NodeChild;
1278
+ as?: NodeChild;
1279
+ alias?: NodeChild;
1280
+ };
1281
+ };
1282
+
1283
+ export type UpdateStatement = XXXStatement & {
1284
+ node_type: "UpdateStatement";
1285
+ children: {
1286
+ table_name?: NodeChild;
1287
+ set: NodeChild;
1288
+ from?: NodeChild;
1289
+ where: NodeChild;
1290
+ };
1291
+ };
1292
+
1293
+ export type WhenClause = BaseNode & {
1294
+ node_type: "WhenClause";
1295
+ children: {
1296
+ not?: NodeChild;
1297
+ matched: NodeChild;
1298
+ by_target_or_source: NodeVecChild;
1299
+ and: NodeChild;
1300
+ then: NodeChild;
1301
+ };
1302
+ };
1303
+
1304
+ export type WhileStatement = LabelableStatement & {
1305
+ node_type: "WhileStatement";
1306
+ children: {
1307
+ condition: NodeChild;
1308
+ do: NodeChild;
1309
+ end_while: NodeVecChild;
1310
+ };
1311
+ };
1312
+
1313
+ export type WindowClause = BaseNode & {
1314
+ token: Token;
1315
+ node_type: "WindowClause";
1316
+ children: {
1317
+ window_exprs: NodeVecChild;
1318
+ };
1319
+ };
1320
+
1321
+ export type WindowExpr = BaseNode & {
1322
+ token: Token;
1323
+ node_type: "WindowExpr";
1324
+ children: {
1325
+ as: NodeChild;
1326
+ window: NodeChild;
1327
+ comma?: NodeChild;
1328
+ };
1329
+ };
1330
+
1331
+ export type WindowFrameClause = BaseNode & {
1332
+ token: Token;
1333
+ node_type: "WindowFrameClause";
1334
+ children: {
1335
+ between?: NodeChild;
1336
+ start: NodeVecChild;
1337
+ and?: NodeChild;
1338
+ end?: NodeVecChild;
1339
+ };
1340
+ };
1341
+
1342
+ export type WindowSpecification = BaseNode & {
1343
+ token: Token;
1344
+ node_type: "WindowSpecification";
1345
+ children: {
1346
+ name?: NodeChild;
1347
+ partitionby: NodeChild;
1348
+ orderby: NodeChild;
1349
+ frame: NodeChild;
1350
+ rparen: NodeChild;
1351
+ };
1352
+ };
1353
+
1354
+ export type WithClause = BaseNode & {
1355
+ token: Token;
1356
+ node_type: "WithClause";
1357
+ children: {
1358
+ queries: { NodeVec: WithQuery[] };
1359
+ recursive?: NodeChild;
1360
+ };
1361
+ };
1362
+
1363
+ export type WithPartitionColumnsClause = BaseNode & {
1364
+ token: Token;
1365
+ node_type: "WithPartitionColumnsClause";
1366
+ children: {
1367
+ partition_columns: NodeVecChild;
1368
+ column_schema_group: NodeChild;
1369
+ };
1370
+ };
1371
+
1372
+ export type WithQuery = BaseNode & {
1373
+ token: Token;
1374
+ node_type: "WithQuery";
1375
+ children: {
1376
+ as: { Node: Keyword };
1377
+ stmt: { Node: GroupedStatement };
1378
+ comma: NodeChild;
1379
+ };
1380
+ };
1381
+
1382
+ export type XXXByExprs = BaseNode & {
1383
+ token: Token;
1384
+ node_type: "XXXByExprs";
1385
+ children: {
1386
+ by: NodeChild;
1387
+ exprs: { NodeVec: Expr[] & UnknownNode[] };
1388
+ };
1389
+ };
1390
+
1391
+