dt-sql-parser 4.5.0-beta.3 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +2 -1
  2. package/dist/index.d.ts +3 -2
  3. package/dist/index.js +2 -2
  4. package/dist/lib/SQLParserBase.d.ts +13 -1
  5. package/dist/lib/SQLParserBase.js +40 -5
  6. package/dist/lib/flink/FlinkSqlParser.d.ts +229 -186
  7. package/dist/lib/flink/FlinkSqlParser.js +3508 -3156
  8. package/dist/lib/flink/FlinkSqlParserListener.d.ts +33 -0
  9. package/dist/lib/flink/FlinkSqlParserVisitor.d.ts +21 -0
  10. package/dist/lib/generic/GenericSqlLexer.d.ts +143 -0
  11. package/dist/lib/generic/GenericSqlLexer.js +603 -0
  12. package/dist/lib/generic/GenericSqlListener.d.ts +1089 -0
  13. package/dist/lib/generic/GenericSqlListener.js +11 -0
  14. package/dist/lib/generic/GenericSqlParser.d.ts +1272 -0
  15. package/dist/lib/generic/GenericSqlParser.js +7641 -0
  16. package/dist/lib/generic/GenericSqlVisitor.d.ts +684 -0
  17. package/dist/lib/generic/GenericSqlVisitor.js +12 -0
  18. package/dist/lib/hive/HiveSqlParser.d.ts +274 -228
  19. package/dist/lib/hive/HiveSqlParser.js +6304 -5912
  20. package/dist/lib/hive/HiveSqlParserListener.d.ts +33 -0
  21. package/dist/lib/hive/HiveSqlParserVisitor.d.ts +21 -0
  22. package/dist/lib/impala/ImpalaSqlParser.d.ts +145 -103
  23. package/dist/lib/impala/ImpalaSqlParser.js +3687 -3320
  24. package/dist/lib/impala/ImpalaSqlParserListener.d.ts +33 -0
  25. package/dist/lib/impala/ImpalaSqlParserVisitor.d.ts +21 -0
  26. package/dist/lib/index.d.ts +2 -0
  27. package/dist/lib/index.js +2 -0
  28. package/dist/lib/mysql/MySqlParser.d.ts +161 -94
  29. package/dist/lib/mysql/MySqlParser.js +9959 -9499
  30. package/dist/lib/mysql/MySqlParserListener.d.ts +79 -5
  31. package/dist/lib/mysql/MySqlParserVisitor.d.ts +49 -3
  32. package/dist/lib/postgresql/PostgreSqlParser.d.ts +108 -71
  33. package/dist/lib/postgresql/PostgreSqlParser.js +13330 -10388
  34. package/dist/lib/postgresql/PostgreSqlParserListener.d.ts +48 -0
  35. package/dist/lib/postgresql/PostgreSqlParserVisitor.d.ts +30 -0
  36. package/dist/lib/spark/SparkSqlParser.d.ts +186 -146
  37. package/dist/lib/spark/SparkSqlParser.js +5368 -5095
  38. package/dist/lib/spark/SparkSqlParserListener.d.ts +33 -0
  39. package/dist/lib/spark/SparkSqlParserVisitor.d.ts +21 -0
  40. package/dist/lib/trino/TrinoSqlLexer.d.ts +297 -296
  41. package/dist/lib/trino/TrinoSqlLexer.js +1451 -1445
  42. package/dist/lib/trino/TrinoSqlListener.d.ts +13 -0
  43. package/dist/lib/trino/TrinoSqlParser.d.ts +308 -297
  44. package/dist/lib/trino/TrinoSqlParser.js +2381 -2300
  45. package/dist/lib/trino/TrinoSqlVisitor.d.ts +8 -0
  46. package/dist/parser/common/basicSQL.d.ts +5 -5
  47. package/dist/parser/common/basicSQL.js +3 -3
  48. package/dist/parser/common/entityCollector.js +14 -2
  49. package/dist/parser/flink/index.js +5 -2
  50. package/dist/parser/generic/genericEntityCollector.d.ts +30 -0
  51. package/dist/parser/generic/genericEntityCollector.js +116 -0
  52. package/dist/parser/generic/genericErrorListener.d.ts +6 -0
  53. package/dist/parser/generic/genericErrorListener.js +56 -0
  54. package/dist/parser/generic/genericSemanticContextCollector.d.ts +9 -0
  55. package/dist/parser/generic/genericSemanticContextCollector.js +14 -0
  56. package/dist/parser/generic/genericSplitListener.d.ts +6 -0
  57. package/dist/parser/generic/genericSplitListener.js +6 -0
  58. package/dist/parser/generic/index.d.ts +33 -0
  59. package/dist/parser/generic/index.js +94 -0
  60. package/dist/parser/index.d.ts +1 -0
  61. package/dist/parser/index.js +1 -0
  62. package/dist/parser/mysql/index.js +3 -1
  63. package/dist/parser/mysql/mysqlEntityCollector.d.ts +2 -1
  64. package/dist/parser/mysql/mysqlEntityCollector.js +13 -3
  65. package/dist/parser/mysql/mysqlErrorListener.js +2 -0
  66. package/dist/parser/postgresql/postgreEntityCollector.d.ts +3 -1
  67. package/dist/parser/postgresql/postgreEntityCollector.js +13 -0
  68. package/dist/parser/spark/index.js +3 -1
  69. package/package.json +1 -1
@@ -25,8 +25,10 @@ import { CreateTableAsSelectContext } from "./FlinkSqlParser.js";
25
25
  import { ColumnOptionDefinitionContext } from "./FlinkSqlParser.js";
26
26
  import { PhysicalColumnDefinitionContext } from "./FlinkSqlParser.js";
27
27
  import { ColumnNameCreateContext } from "./FlinkSqlParser.js";
28
+ import { EmptyColumnContext } from "./FlinkSqlParser.js";
28
29
  import { ColumnNameContext } from "./FlinkSqlParser.js";
29
30
  import { ColumnNamePathContext } from "./FlinkSqlParser.js";
31
+ import { ColumnNamePathAllowEmptyContext } from "./FlinkSqlParser.js";
30
32
  import { ColumnNameListContext } from "./FlinkSqlParser.js";
31
33
  import { ColumnTypeContext } from "./FlinkSqlParser.js";
32
34
  import { LengthOneDimensionContext } from "./FlinkSqlParser.js";
@@ -209,6 +211,7 @@ import { TablePathContext } from "./FlinkSqlParser.js";
209
211
  import { ViewPathContext } from "./FlinkSqlParser.js";
210
212
  import { ViewPathCreateContext } from "./FlinkSqlParser.js";
211
213
  import { UidContext } from "./FlinkSqlParser.js";
214
+ import { UidAllowEmptyContext } from "./FlinkSqlParser.js";
212
215
  import { WithOptionContext } from "./FlinkSqlParser.js";
213
216
  import { IfNotExistsContext } from "./FlinkSqlParser.js";
214
217
  import { IfExistsContext } from "./FlinkSqlParser.js";
@@ -499,6 +502,16 @@ export declare class FlinkSqlParserListener implements ParseTreeListener {
499
502
  * @param ctx the parse tree
500
503
  */
501
504
  exitColumnNameCreate?: (ctx: ColumnNameCreateContext) => void;
505
+ /**
506
+ * Enter a parse tree produced by `FlinkSqlParser.emptyColumn`.
507
+ * @param ctx the parse tree
508
+ */
509
+ enterEmptyColumn?: (ctx: EmptyColumnContext) => void;
510
+ /**
511
+ * Exit a parse tree produced by `FlinkSqlParser.emptyColumn`.
512
+ * @param ctx the parse tree
513
+ */
514
+ exitEmptyColumn?: (ctx: EmptyColumnContext) => void;
502
515
  /**
503
516
  * Enter a parse tree produced by `FlinkSqlParser.columnName`.
504
517
  * @param ctx the parse tree
@@ -519,6 +532,16 @@ export declare class FlinkSqlParserListener implements ParseTreeListener {
519
532
  * @param ctx the parse tree
520
533
  */
521
534
  exitColumnNamePath?: (ctx: ColumnNamePathContext) => void;
535
+ /**
536
+ * Enter a parse tree produced by `FlinkSqlParser.columnNamePathAllowEmpty`.
537
+ * @param ctx the parse tree
538
+ */
539
+ enterColumnNamePathAllowEmpty?: (ctx: ColumnNamePathAllowEmptyContext) => void;
540
+ /**
541
+ * Exit a parse tree produced by `FlinkSqlParser.columnNamePathAllowEmpty`.
542
+ * @param ctx the parse tree
543
+ */
544
+ exitColumnNamePathAllowEmpty?: (ctx: ColumnNamePathAllowEmptyContext) => void;
522
545
  /**
523
546
  * Enter a parse tree produced by `FlinkSqlParser.columnNameList`.
524
547
  * @param ctx the parse tree
@@ -2401,6 +2424,16 @@ export declare class FlinkSqlParserListener implements ParseTreeListener {
2401
2424
  * @param ctx the parse tree
2402
2425
  */
2403
2426
  exitUid?: (ctx: UidContext) => void;
2427
+ /**
2428
+ * Enter a parse tree produced by `FlinkSqlParser.uidAllowEmpty`.
2429
+ * @param ctx the parse tree
2430
+ */
2431
+ enterUidAllowEmpty?: (ctx: UidAllowEmptyContext) => void;
2432
+ /**
2433
+ * Exit a parse tree produced by `FlinkSqlParser.uidAllowEmpty`.
2434
+ * @param ctx the parse tree
2435
+ */
2436
+ exitUidAllowEmpty?: (ctx: UidAllowEmptyContext) => void;
2404
2437
  /**
2405
2438
  * Enter a parse tree produced by `FlinkSqlParser.withOption`.
2406
2439
  * @param ctx the parse tree
@@ -25,8 +25,10 @@ import { CreateTableAsSelectContext } from "./FlinkSqlParser.js";
25
25
  import { ColumnOptionDefinitionContext } from "./FlinkSqlParser.js";
26
26
  import { PhysicalColumnDefinitionContext } from "./FlinkSqlParser.js";
27
27
  import { ColumnNameCreateContext } from "./FlinkSqlParser.js";
28
+ import { EmptyColumnContext } from "./FlinkSqlParser.js";
28
29
  import { ColumnNameContext } from "./FlinkSqlParser.js";
29
30
  import { ColumnNamePathContext } from "./FlinkSqlParser.js";
31
+ import { ColumnNamePathAllowEmptyContext } from "./FlinkSqlParser.js";
30
32
  import { ColumnNameListContext } from "./FlinkSqlParser.js";
31
33
  import { ColumnTypeContext } from "./FlinkSqlParser.js";
32
34
  import { LengthOneDimensionContext } from "./FlinkSqlParser.js";
@@ -209,6 +211,7 @@ import { TablePathContext } from "./FlinkSqlParser.js";
209
211
  import { ViewPathContext } from "./FlinkSqlParser.js";
210
212
  import { ViewPathCreateContext } from "./FlinkSqlParser.js";
211
213
  import { UidContext } from "./FlinkSqlParser.js";
214
+ import { UidAllowEmptyContext } from "./FlinkSqlParser.js";
212
215
  import { WithOptionContext } from "./FlinkSqlParser.js";
213
216
  import { IfNotExistsContext } from "./FlinkSqlParser.js";
214
217
  import { IfExistsContext } from "./FlinkSqlParser.js";
@@ -398,6 +401,12 @@ export declare class FlinkSqlParserVisitor<Result> extends AbstractParseTreeVisi
398
401
  * @return the visitor result
399
402
  */
400
403
  visitColumnNameCreate?: (ctx: ColumnNameCreateContext) => Result;
404
+ /**
405
+ * Visit a parse tree produced by `FlinkSqlParser.emptyColumn`.
406
+ * @param ctx the parse tree
407
+ * @return the visitor result
408
+ */
409
+ visitEmptyColumn?: (ctx: EmptyColumnContext) => Result;
401
410
  /**
402
411
  * Visit a parse tree produced by `FlinkSqlParser.columnName`.
403
412
  * @param ctx the parse tree
@@ -410,6 +419,12 @@ export declare class FlinkSqlParserVisitor<Result> extends AbstractParseTreeVisi
410
419
  * @return the visitor result
411
420
  */
412
421
  visitColumnNamePath?: (ctx: ColumnNamePathContext) => Result;
422
+ /**
423
+ * Visit a parse tree produced by `FlinkSqlParser.columnNamePathAllowEmpty`.
424
+ * @param ctx the parse tree
425
+ * @return the visitor result
426
+ */
427
+ visitColumnNamePathAllowEmpty?: (ctx: ColumnNamePathAllowEmptyContext) => Result;
413
428
  /**
414
429
  * Visit a parse tree produced by `FlinkSqlParser.columnNameList`.
415
430
  * @param ctx the parse tree
@@ -1533,6 +1548,12 @@ export declare class FlinkSqlParserVisitor<Result> extends AbstractParseTreeVisi
1533
1548
  * @return the visitor result
1534
1549
  */
1535
1550
  visitUid?: (ctx: UidContext) => Result;
1551
+ /**
1552
+ * Visit a parse tree produced by `FlinkSqlParser.uidAllowEmpty`.
1553
+ * @param ctx the parse tree
1554
+ * @return the visitor result
1555
+ */
1556
+ visitUidAllowEmpty?: (ctx: UidAllowEmptyContext) => Result;
1536
1557
  /**
1537
1558
  * Visit a parse tree produced by `FlinkSqlParser.withOption`.
1538
1559
  * @param ctx the parse tree
@@ -0,0 +1,143 @@
1
+ import * as antlr from "antlr4ng";
2
+ export declare class GenericSqlLexer extends antlr.Lexer {
3
+ static readonly T__0 = 1;
4
+ static readonly T__1 = 2;
5
+ static readonly T__2 = 3;
6
+ static readonly T__3 = 4;
7
+ static readonly KW_ADD = 5;
8
+ static readonly KW_ALL = 6;
9
+ static readonly KW_ALTER = 7;
10
+ static readonly KW_AND = 8;
11
+ static readonly KW_AS = 9;
12
+ static readonly KW_ASC = 10;
13
+ static readonly KW_BETWEEN = 11;
14
+ static readonly KW_BIGINT = 12;
15
+ static readonly KW_BINARY = 13;
16
+ static readonly KW_BOOLEAN = 14;
17
+ static readonly KW_BY = 15;
18
+ static readonly KW_CASE = 16;
19
+ static readonly KW_CAST = 17;
20
+ static readonly KW_CHAR = 18;
21
+ static readonly KW_CHECK = 19;
22
+ static readonly KW_COALESCE = 20;
23
+ static readonly KW_COLUMN = 21;
24
+ static readonly KW_CONSTRAINT = 22;
25
+ static readonly KW_CREATE = 23;
26
+ static readonly KW_CROSS = 24;
27
+ static readonly KW_DATE = 25;
28
+ static readonly KW_DECIMAL = 26;
29
+ static readonly KW_DEFAULT = 27;
30
+ static readonly KW_DELETE = 28;
31
+ static readonly KW_DESC = 29;
32
+ static readonly KW_DISTINCT = 30;
33
+ static readonly KW_DOUBLE = 31;
34
+ static readonly KW_DROP = 32;
35
+ static readonly KW_ELSE = 33;
36
+ static readonly KW_END = 34;
37
+ static readonly KW_ESCAPE = 35;
38
+ static readonly KW_EXCEPT = 36;
39
+ static readonly KW_EXISTS = 37;
40
+ static readonly KW_FALSE = 38;
41
+ static readonly KW_FIRST = 39;
42
+ static readonly KW_FLOAT = 40;
43
+ static readonly KW_FOREIGN = 41;
44
+ static readonly KW_FROM = 42;
45
+ static readonly KW_FULL = 43;
46
+ static readonly KW_GROUP = 44;
47
+ static readonly KW_HAVING = 45;
48
+ static readonly KW_IF = 46;
49
+ static readonly KW_IN = 47;
50
+ static readonly KW_INNER = 48;
51
+ static readonly KW_INSERT = 49;
52
+ static readonly KW_INT = 50;
53
+ static readonly KW_INTEGER = 51;
54
+ static readonly KW_INTERSECT = 52;
55
+ static readonly KW_INTO = 53;
56
+ static readonly KW_IS = 54;
57
+ static readonly KW_JOIN = 55;
58
+ static readonly KW_KEY = 56;
59
+ static readonly KW_LAST = 57;
60
+ static readonly KW_LEFT = 58;
61
+ static readonly KW_LIKE = 59;
62
+ static readonly KW_LIMIT = 60;
63
+ static readonly KW_NOT = 61;
64
+ static readonly KW_NULL = 62;
65
+ static readonly KW_NULLIF = 63;
66
+ static readonly KW_NULLS = 64;
67
+ static readonly KW_NUMERIC = 65;
68
+ static readonly KW_OFFSET = 66;
69
+ static readonly KW_ON = 67;
70
+ static readonly KW_OR = 68;
71
+ static readonly KW_ORDER = 69;
72
+ static readonly KW_OUTER = 70;
73
+ static readonly KW_PRIMARY = 71;
74
+ static readonly KW_RECURSIVE = 72;
75
+ static readonly KW_REFERENCES = 73;
76
+ static readonly KW_RENAME = 74;
77
+ static readonly KW_RIGHT = 75;
78
+ static readonly KW_SELECT = 76;
79
+ static readonly KW_SET = 77;
80
+ static readonly KW_SMALLINT = 78;
81
+ static readonly KW_TABLE = 79;
82
+ static readonly KW_TEXT = 80;
83
+ static readonly KW_THEN = 81;
84
+ static readonly KW_TIME = 82;
85
+ static readonly KW_TIMESTAMP = 83;
86
+ static readonly KW_TINYINT = 84;
87
+ static readonly KW_TO = 85;
88
+ static readonly KW_TRUE = 86;
89
+ static readonly KW_UNION = 87;
90
+ static readonly KW_UNIQUE = 88;
91
+ static readonly KW_UPDATE = 89;
92
+ static readonly KW_VARCHAR = 90;
93
+ static readonly KW_VARBINARY = 91;
94
+ static readonly KW_WHEN = 92;
95
+ static readonly KW_WHERE = 93;
96
+ static readonly KW_WITH = 94;
97
+ static readonly EQ = 95;
98
+ static readonly NEQ = 96;
99
+ static readonly LT = 97;
100
+ static readonly LTE = 98;
101
+ static readonly GT = 99;
102
+ static readonly GTE = 100;
103
+ static readonly PLUS = 101;
104
+ static readonly MINUS = 102;
105
+ static readonly ASTERISK = 103;
106
+ static readonly SLASH = 104;
107
+ static readonly PERCENT = 105;
108
+ static readonly CONCAT = 106;
109
+ static readonly QUESTION_MARK = 107;
110
+ static readonly SEMICOLON = 108;
111
+ static readonly STRING = 109;
112
+ static readonly BINARY_LITERAL = 110;
113
+ static readonly INTEGER_VALUE = 111;
114
+ static readonly DECIMAL_VALUE = 112;
115
+ static readonly DOUBLE_VALUE = 113;
116
+ static readonly IDENTIFIER = 114;
117
+ static readonly DIGIT_IDENTIFIER = 115;
118
+ static readonly QUOTED_IDENTIFIER = 116;
119
+ static readonly BACKQUOTED_IDENTIFIER = 117;
120
+ static readonly LINE_COMMENT = 118;
121
+ static readonly BRACKETED_COMMENT = 119;
122
+ static readonly WHITE_SPACE = 120;
123
+ static readonly UNRECOGNIZED = 121;
124
+ static readonly channelNames: string[];
125
+ static readonly literalNames: (string | null)[];
126
+ static readonly symbolicNames: (string | null)[];
127
+ static readonly modeNames: string[];
128
+ static readonly ruleNames: string[];
129
+ constructor(input: antlr.CharStream);
130
+ get grammarFileName(): string;
131
+ get literalNames(): (string | null)[];
132
+ get symbolicNames(): (string | null)[];
133
+ get ruleNames(): string[];
134
+ get serializedATN(): number[];
135
+ get channelNames(): string[];
136
+ get modeNames(): string[];
137
+ static readonly _serializedATN: number[];
138
+ private static __ATN;
139
+ static get _ATN(): antlr.ATN;
140
+ private static readonly vocabulary;
141
+ get vocabulary(): antlr.Vocabulary;
142
+ private static readonly decisionsToDFA;
143
+ }