dt-sql-parser 4.0.1 → 4.1.0-beta.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 (88) hide show
  1. package/README.md +6 -1
  2. package/dist/lib/flink/FlinkSqlLexer.js +1 -2
  3. package/dist/lib/flink/FlinkSqlParser.d.ts +175 -174
  4. package/dist/lib/flink/FlinkSqlParser.js +2315 -2388
  5. package/dist/lib/flink/FlinkSqlParserListener.d.ts +5 -16
  6. package/dist/lib/flink/FlinkSqlParserVisitor.d.ts +3 -10
  7. package/dist/lib/hive/HiveSqlLexer.js +1 -2
  8. package/dist/lib/hive/HiveSqlParser.d.ts +3 -1
  9. package/dist/lib/hive/HiveSqlParser.js +8 -9
  10. package/dist/lib/impala/ImpalaSqlLexer.js +1 -2
  11. package/dist/lib/impala/ImpalaSqlParser.d.ts +123 -107
  12. package/dist/lib/impala/ImpalaSqlParser.js +3223 -3155
  13. package/dist/lib/impala/ImpalaSqlParserListener.d.ts +22 -0
  14. package/dist/lib/impala/ImpalaSqlParserVisitor.d.ts +14 -0
  15. package/dist/lib/mysql/MySqlLexer.js +1 -2
  16. package/dist/lib/mysql/MySqlParser.d.ts +469 -422
  17. package/dist/lib/mysql/MySqlParser.js +11463 -10512
  18. package/dist/lib/mysql/MySqlParserListener.d.ts +42 -20
  19. package/dist/lib/mysql/MySqlParserVisitor.d.ts +26 -12
  20. package/dist/lib/postgresql/PostgreSqlLexer.js +1 -2
  21. package/dist/lib/postgresql/PostgreSqlParser.d.ts +2025 -6265
  22. package/dist/lib/postgresql/PostgreSqlParser.js +60092 -88368
  23. package/dist/lib/postgresql/PostgreSqlParserListener.d.ts +1688 -6083
  24. package/dist/lib/postgresql/PostgreSqlParserVisitor.d.ts +712 -3511
  25. package/dist/lib/spark/SparkSqlLexer.js +1 -2
  26. package/dist/lib/spark/SparkSqlParser.d.ts +16 -13
  27. package/dist/lib/spark/SparkSqlParser.js +50 -51
  28. package/dist/lib/spark/SparkSqlParserListener.d.ts +10 -10
  29. package/dist/lib/spark/SparkSqlParserVisitor.d.ts +6 -6
  30. package/dist/lib/trino/TrinoSqlLexer.d.ts +323 -260
  31. package/dist/lib/trino/TrinoSqlLexer.js +1610 -1264
  32. package/dist/lib/trino/TrinoSqlListener.d.ts +1311 -200
  33. package/dist/lib/trino/TrinoSqlParser.d.ts +1908 -562
  34. package/dist/lib/trino/TrinoSqlParser.js +22629 -13412
  35. package/dist/lib/trino/TrinoSqlVisitor.d.ts +761 -69
  36. package/dist/locale/locale.d.ts +41 -0
  37. package/dist/locale/locale.js +43 -0
  38. package/dist/parser/common/basicSQL.d.ts +7 -2
  39. package/dist/parser/common/basicSQL.js +5 -15
  40. package/dist/parser/common/entityCollector.d.ts +60 -12
  41. package/dist/parser/common/entityCollector.js +141 -17
  42. package/dist/parser/common/parseErrorListener.d.ts +6 -3
  43. package/dist/parser/common/parseErrorListener.js +83 -2
  44. package/dist/parser/common/textAndWord.d.ts +6 -9
  45. package/dist/parser/common/textAndWord.js +9 -20
  46. package/dist/parser/common/transform.d.ts +8 -0
  47. package/dist/parser/common/transform.js +11 -0
  48. package/dist/parser/common/types.d.ts +1 -0
  49. package/dist/parser/flink/flinkEntityCollector.js +40 -6
  50. package/dist/parser/flink/flinkErrorListener.d.ts +9 -0
  51. package/dist/parser/flink/flinkErrorListener.js +67 -0
  52. package/dist/parser/flink/index.d.ts +3 -0
  53. package/dist/parser/flink/index.js +13 -9
  54. package/dist/parser/hive/hiveEntityCollector.js +40 -6
  55. package/dist/parser/hive/hiveErrorListener.d.ts +9 -0
  56. package/dist/parser/hive/hiveErrorListener.js +65 -0
  57. package/dist/parser/hive/index.d.ts +3 -0
  58. package/dist/parser/hive/index.js +13 -9
  59. package/dist/parser/impala/ImpalaErrorListener.d.ts +9 -0
  60. package/dist/parser/impala/ImpalaErrorListener.js +63 -0
  61. package/dist/parser/impala/impalaEntityCollector.js +51 -6
  62. package/dist/parser/impala/index.d.ts +3 -0
  63. package/dist/parser/impala/index.js +4 -0
  64. package/dist/parser/mysql/index.d.ts +3 -0
  65. package/dist/parser/mysql/index.js +4 -0
  66. package/dist/parser/mysql/mysqlEntityCollector.d.ts +3 -1
  67. package/dist/parser/mysql/mysqlEntityCollector.js +40 -5
  68. package/dist/parser/mysql/mysqlErrorListener.d.ts +9 -0
  69. package/dist/parser/mysql/mysqlErrorListener.js +63 -0
  70. package/dist/parser/postgresql/index.d.ts +3 -0
  71. package/dist/parser/postgresql/index.js +17 -13
  72. package/dist/parser/postgresql/postgreEntityCollector.d.ts +5 -1
  73. package/dist/parser/postgresql/postgreEntityCollector.js +44 -4
  74. package/dist/parser/postgresql/postgreErrorListener.d.ts +9 -0
  75. package/dist/parser/postgresql/postgreErrorListener.js +71 -0
  76. package/dist/parser/spark/index.d.ts +3 -0
  77. package/dist/parser/spark/index.js +4 -0
  78. package/dist/parser/spark/sparkEntityCollector.d.ts +1 -1
  79. package/dist/parser/spark/sparkEntityCollector.js +43 -6
  80. package/dist/parser/spark/sparkErrorListener.d.ts +9 -0
  81. package/dist/parser/spark/sparkErrorListener.js +63 -0
  82. package/dist/parser/trino/index.d.ts +3 -0
  83. package/dist/parser/trino/index.js +23 -10
  84. package/dist/parser/trino/trinoEntityCollector.d.ts +6 -4
  85. package/dist/parser/trino/trinoEntityCollector.js +44 -9
  86. package/dist/parser/trino/trinoErrorListener.d.ts +9 -0
  87. package/dist/parser/trino/trinoErrorListener.js +65 -0
  88. package/package.json +40 -12
@@ -16,6 +16,8 @@ import { CreateEventContext } from "./MySqlParser.js";
16
16
  import { CreateIndexContext } from "./MySqlParser.js";
17
17
  import { CreateLogfileGroupContext } from "./MySqlParser.js";
18
18
  import { CreateProcedureContext } from "./MySqlParser.js";
19
+ import { CreateFunctionContext } from "./MySqlParser.js";
20
+ import { CreateFunctionLoadableContext } from "./MySqlParser.js";
19
21
  import { CreateRoleContext } from "./MySqlParser.js";
20
22
  import { CreateServerContext } from "./MySqlParser.js";
21
23
  import { QueryCreateTableContext } from "./MySqlParser.js";
@@ -40,6 +42,7 @@ import { EnableTypeContext } from "./MySqlParser.js";
40
42
  import { IndexTypeContext } from "./MySqlParser.js";
41
43
  import { IndexOptionContext } from "./MySqlParser.js";
42
44
  import { ProcedureParameterContext } from "./MySqlParser.js";
45
+ import { FunctionParameterContext } from "./MySqlParser.js";
43
46
  import { RoutineCommentContext } from "./MySqlParser.js";
44
47
  import { RoutineLanguageContext } from "./MySqlParser.js";
45
48
  import { RoutineBehaviorContext } from "./MySqlParser.js";
@@ -435,7 +438,6 @@ import { OptimizeTableContext } from "./MySqlParser.js";
435
438
  import { RepairTableContext } from "./MySqlParser.js";
436
439
  import { TableActionOptionContext } from "./MySqlParser.js";
437
440
  import { CheckTableOptionContext } from "./MySqlParser.js";
438
- import { CreateFunctionContext } from "./MySqlParser.js";
439
441
  import { InstallComponentContext } from "./MySqlParser.js";
440
442
  import { VariableExprContext } from "./MySqlParser.js";
441
443
  import { UninstallComponentContext } from "./MySqlParser.js";
@@ -596,8 +598,8 @@ import { SimpleFunctionCallContext } from "./MySqlParser.js";
596
598
  import { CurrentUserContext } from "./MySqlParser.js";
597
599
  import { DataTypeFunctionCallContext } from "./MySqlParser.js";
598
600
  import { ValuesFunctionCallContext } from "./MySqlParser.js";
599
- import { CaseExpressionFunctionCallContext } from "./MySqlParser.js";
600
601
  import { CaseFunctionCallContext } from "./MySqlParser.js";
602
+ import { CaseExpressionFunctionCallContext } from "./MySqlParser.js";
601
603
  import { CharFunctionCallContext } from "./MySqlParser.js";
602
604
  import { PositionFunctionCallContext } from "./MySqlParser.js";
603
605
  import { SubstrFunctionCallContext } from "./MySqlParser.js";
@@ -843,6 +845,26 @@ export declare class MySqlParserListener implements ParseTreeListener {
843
845
  * @param ctx the parse tree
844
846
  */
845
847
  exitCreateProcedure?: (ctx: CreateProcedureContext) => void;
848
+ /**
849
+ * Enter a parse tree produced by `MySqlParser.createFunction`.
850
+ * @param ctx the parse tree
851
+ */
852
+ enterCreateFunction?: (ctx: CreateFunctionContext) => void;
853
+ /**
854
+ * Exit a parse tree produced by `MySqlParser.createFunction`.
855
+ * @param ctx the parse tree
856
+ */
857
+ exitCreateFunction?: (ctx: CreateFunctionContext) => void;
858
+ /**
859
+ * Enter a parse tree produced by `MySqlParser.createFunctionLoadable`.
860
+ * @param ctx the parse tree
861
+ */
862
+ enterCreateFunctionLoadable?: (ctx: CreateFunctionLoadableContext) => void;
863
+ /**
864
+ * Exit a parse tree produced by `MySqlParser.createFunctionLoadable`.
865
+ * @param ctx the parse tree
866
+ */
867
+ exitCreateFunctionLoadable?: (ctx: CreateFunctionLoadableContext) => void;
846
868
  /**
847
869
  * Enter a parse tree produced by `MySqlParser.createRole`.
848
870
  * @param ctx the parse tree
@@ -1093,6 +1115,16 @@ export declare class MySqlParserListener implements ParseTreeListener {
1093
1115
  * @param ctx the parse tree
1094
1116
  */
1095
1117
  exitProcedureParameter?: (ctx: ProcedureParameterContext) => void;
1118
+ /**
1119
+ * Enter a parse tree produced by `MySqlParser.functionParameter`.
1120
+ * @param ctx the parse tree
1121
+ */
1122
+ enterFunctionParameter?: (ctx: FunctionParameterContext) => void;
1123
+ /**
1124
+ * Exit a parse tree produced by `MySqlParser.functionParameter`.
1125
+ * @param ctx the parse tree
1126
+ */
1127
+ exitFunctionParameter?: (ctx: FunctionParameterContext) => void;
1096
1128
  /**
1097
1129
  * Enter a parse tree produced by the `routineComment`
1098
1130
  * labeled alternative in `MySqlParser.routineOption`.
@@ -5429,16 +5461,6 @@ export declare class MySqlParserListener implements ParseTreeListener {
5429
5461
  * @param ctx the parse tree
5430
5462
  */
5431
5463
  exitCheckTableOption?: (ctx: CheckTableOptionContext) => void;
5432
- /**
5433
- * Enter a parse tree produced by `MySqlParser.createFunction`.
5434
- * @param ctx the parse tree
5435
- */
5436
- enterCreateFunction?: (ctx: CreateFunctionContext) => void;
5437
- /**
5438
- * Exit a parse tree produced by `MySqlParser.createFunction`.
5439
- * @param ctx the parse tree
5440
- */
5441
- exitCreateFunction?: (ctx: CreateFunctionContext) => void;
5442
5464
  /**
5443
5465
  * Enter a parse tree produced by `MySqlParser.installComponent`.
5444
5466
  * @param ctx the parse tree
@@ -7148,29 +7170,29 @@ export declare class MySqlParserListener implements ParseTreeListener {
7148
7170
  */
7149
7171
  exitValuesFunctionCall?: (ctx: ValuesFunctionCallContext) => void;
7150
7172
  /**
7151
- * Enter a parse tree produced by the `caseExpressionFunctionCall`
7173
+ * Enter a parse tree produced by the `caseFunctionCall`
7152
7174
  * labeled alternative in `MySqlParser.specificFunction`.
7153
7175
  * @param ctx the parse tree
7154
7176
  */
7155
- enterCaseExpressionFunctionCall?: (ctx: CaseExpressionFunctionCallContext) => void;
7177
+ enterCaseFunctionCall?: (ctx: CaseFunctionCallContext) => void;
7156
7178
  /**
7157
- * Exit a parse tree produced by the `caseExpressionFunctionCall`
7179
+ * Exit a parse tree produced by the `caseFunctionCall`
7158
7180
  * labeled alternative in `MySqlParser.specificFunction`.
7159
7181
  * @param ctx the parse tree
7160
7182
  */
7161
- exitCaseExpressionFunctionCall?: (ctx: CaseExpressionFunctionCallContext) => void;
7183
+ exitCaseFunctionCall?: (ctx: CaseFunctionCallContext) => void;
7162
7184
  /**
7163
- * Enter a parse tree produced by the `caseFunctionCall`
7185
+ * Enter a parse tree produced by the `caseExpressionFunctionCall`
7164
7186
  * labeled alternative in `MySqlParser.specificFunction`.
7165
7187
  * @param ctx the parse tree
7166
7188
  */
7167
- enterCaseFunctionCall?: (ctx: CaseFunctionCallContext) => void;
7189
+ enterCaseExpressionFunctionCall?: (ctx: CaseExpressionFunctionCallContext) => void;
7168
7190
  /**
7169
- * Exit a parse tree produced by the `caseFunctionCall`
7191
+ * Exit a parse tree produced by the `caseExpressionFunctionCall`
7170
7192
  * labeled alternative in `MySqlParser.specificFunction`.
7171
7193
  * @param ctx the parse tree
7172
7194
  */
7173
- exitCaseFunctionCall?: (ctx: CaseFunctionCallContext) => void;
7195
+ exitCaseExpressionFunctionCall?: (ctx: CaseExpressionFunctionCallContext) => void;
7174
7196
  /**
7175
7197
  * Enter a parse tree produced by the `charFunctionCall`
7176
7198
  * labeled alternative in `MySqlParser.specificFunction`.
@@ -16,6 +16,8 @@ import { CreateEventContext } from "./MySqlParser.js";
16
16
  import { CreateIndexContext } from "./MySqlParser.js";
17
17
  import { CreateLogfileGroupContext } from "./MySqlParser.js";
18
18
  import { CreateProcedureContext } from "./MySqlParser.js";
19
+ import { CreateFunctionContext } from "./MySqlParser.js";
20
+ import { CreateFunctionLoadableContext } from "./MySqlParser.js";
19
21
  import { CreateRoleContext } from "./MySqlParser.js";
20
22
  import { CreateServerContext } from "./MySqlParser.js";
21
23
  import { QueryCreateTableContext } from "./MySqlParser.js";
@@ -40,6 +42,7 @@ import { EnableTypeContext } from "./MySqlParser.js";
40
42
  import { IndexTypeContext } from "./MySqlParser.js";
41
43
  import { IndexOptionContext } from "./MySqlParser.js";
42
44
  import { ProcedureParameterContext } from "./MySqlParser.js";
45
+ import { FunctionParameterContext } from "./MySqlParser.js";
43
46
  import { RoutineCommentContext } from "./MySqlParser.js";
44
47
  import { RoutineLanguageContext } from "./MySqlParser.js";
45
48
  import { RoutineBehaviorContext } from "./MySqlParser.js";
@@ -435,7 +438,6 @@ import { OptimizeTableContext } from "./MySqlParser.js";
435
438
  import { RepairTableContext } from "./MySqlParser.js";
436
439
  import { TableActionOptionContext } from "./MySqlParser.js";
437
440
  import { CheckTableOptionContext } from "./MySqlParser.js";
438
- import { CreateFunctionContext } from "./MySqlParser.js";
439
441
  import { InstallComponentContext } from "./MySqlParser.js";
440
442
  import { VariableExprContext } from "./MySqlParser.js";
441
443
  import { UninstallComponentContext } from "./MySqlParser.js";
@@ -596,8 +598,8 @@ import { SimpleFunctionCallContext } from "./MySqlParser.js";
596
598
  import { CurrentUserContext } from "./MySqlParser.js";
597
599
  import { DataTypeFunctionCallContext } from "./MySqlParser.js";
598
600
  import { ValuesFunctionCallContext } from "./MySqlParser.js";
599
- import { CaseExpressionFunctionCallContext } from "./MySqlParser.js";
600
601
  import { CaseFunctionCallContext } from "./MySqlParser.js";
602
+ import { CaseExpressionFunctionCallContext } from "./MySqlParser.js";
601
603
  import { CharFunctionCallContext } from "./MySqlParser.js";
602
604
  import { PositionFunctionCallContext } from "./MySqlParser.js";
603
605
  import { SubstrFunctionCallContext } from "./MySqlParser.js";
@@ -778,6 +780,18 @@ export declare class MySqlParserVisitor<Result> extends AbstractParseTreeVisitor
778
780
  * @return the visitor result
779
781
  */
780
782
  visitCreateProcedure?: (ctx: CreateProcedureContext) => Result;
783
+ /**
784
+ * Visit a parse tree produced by `MySqlParser.createFunction`.
785
+ * @param ctx the parse tree
786
+ * @return the visitor result
787
+ */
788
+ visitCreateFunction?: (ctx: CreateFunctionContext) => Result;
789
+ /**
790
+ * Visit a parse tree produced by `MySqlParser.createFunctionLoadable`.
791
+ * @param ctx the parse tree
792
+ * @return the visitor result
793
+ */
794
+ visitCreateFunctionLoadable?: (ctx: CreateFunctionLoadableContext) => Result;
781
795
  /**
782
796
  * Visit a parse tree produced by `MySqlParser.createRole`.
783
797
  * @param ctx the parse tree
@@ -927,6 +941,12 @@ export declare class MySqlParserVisitor<Result> extends AbstractParseTreeVisitor
927
941
  * @return the visitor result
928
942
  */
929
943
  visitProcedureParameter?: (ctx: ProcedureParameterContext) => Result;
944
+ /**
945
+ * Visit a parse tree produced by `MySqlParser.functionParameter`.
946
+ * @param ctx the parse tree
947
+ * @return the visitor result
948
+ */
949
+ visitFunctionParameter?: (ctx: FunctionParameterContext) => Result;
930
950
  /**
931
951
  * Visit a parse tree produced by the `routineComment`
932
952
  * labeled alternative in `MySqlParser.routineOption`.
@@ -3490,12 +3510,6 @@ export declare class MySqlParserVisitor<Result> extends AbstractParseTreeVisitor
3490
3510
  * @return the visitor result
3491
3511
  */
3492
3512
  visitCheckTableOption?: (ctx: CheckTableOptionContext) => Result;
3493
- /**
3494
- * Visit a parse tree produced by `MySqlParser.createFunction`.
3495
- * @param ctx the parse tree
3496
- * @return the visitor result
3497
- */
3498
- visitCreateFunction?: (ctx: CreateFunctionContext) => Result;
3499
3513
  /**
3500
3514
  * Visit a parse tree produced by `MySqlParser.installComponent`.
3501
3515
  * @param ctx the parse tree
@@ -4511,19 +4525,19 @@ export declare class MySqlParserVisitor<Result> extends AbstractParseTreeVisitor
4511
4525
  */
4512
4526
  visitValuesFunctionCall?: (ctx: ValuesFunctionCallContext) => Result;
4513
4527
  /**
4514
- * Visit a parse tree produced by the `caseExpressionFunctionCall`
4528
+ * Visit a parse tree produced by the `caseFunctionCall`
4515
4529
  * labeled alternative in `MySqlParser.specificFunction`.
4516
4530
  * @param ctx the parse tree
4517
4531
  * @return the visitor result
4518
4532
  */
4519
- visitCaseExpressionFunctionCall?: (ctx: CaseExpressionFunctionCallContext) => Result;
4533
+ visitCaseFunctionCall?: (ctx: CaseFunctionCallContext) => Result;
4520
4534
  /**
4521
- * Visit a parse tree produced by the `caseFunctionCall`
4535
+ * Visit a parse tree produced by the `caseExpressionFunctionCall`
4522
4536
  * labeled alternative in `MySqlParser.specificFunction`.
4523
4537
  * @param ctx the parse tree
4524
4538
  * @return the visitor result
4525
4539
  */
4526
- visitCaseFunctionCall?: (ctx: CaseFunctionCallContext) => Result;
4540
+ visitCaseExpressionFunctionCall?: (ctx: CaseExpressionFunctionCallContext) => Result;
4527
4541
  /**
4528
4542
  * Visit a parse tree produced by the `charFunctionCall`
4529
4543
  * labeled alternative in `MySqlParser.specificFunction`.
@@ -1,7 +1,7 @@
1
1
  // Generated from dt-sql-parser/src/grammar/postgresql/PostgreSqlLexer.g4 by ANTLR 4.13.1
2
2
  // @ts-nocheck
3
3
  import * as antlr from "antlr4ng";
4
- class PostgreSqlLexer extends antlr.Lexer {
4
+ export class PostgreSqlLexer extends antlr.Lexer {
5
5
  constructor(input) {
6
6
  super(input);
7
7
  this.interpreter = new antlr.LexerATNSimulator(this, PostgreSqlLexer._ATN, PostgreSqlLexer.decisionsToDFA, new antlr.PredictionContextCache());
@@ -3217,4 +3217,3 @@ PostgreSqlLexer._serializedATN = [
3217
3217
  ];
3218
3218
  PostgreSqlLexer.vocabulary = new antlr.Vocabulary(PostgreSqlLexer.literalNames, PostgreSqlLexer.symbolicNames, []);
3219
3219
  PostgreSqlLexer.decisionsToDFA = PostgreSqlLexer._ATN.decisionToState.map((ds, index) => new antlr.DFA(ds, index));
3220
- export { PostgreSqlLexer };