dt-sql-parser 4.0.0-ng.2 → 4.0.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.
- package/README.md +119 -112
- package/dist/index.d.ts +14 -6
- package/dist/index.js +11 -4
- package/dist/lib/SQLParserBase.d.ts +8 -0
- package/dist/lib/SQLParserBase.js +14 -0
- package/dist/lib/{flinksql → flink}/FlinkSqlLexer.d.ts +2 -2
- package/dist/lib/{flinksql → flink}/FlinkSqlLexer.js +2 -1
- package/dist/lib/{flinksql → flink}/FlinkSqlParser.d.ts +5 -11
- package/dist/lib/{flinksql → flink}/FlinkSqlParser.js +2065 -2054
- package/dist/lib/{flinksql → flink}/FlinkSqlParserListener.d.ts +0 -13
- package/dist/lib/{flinksql → flink}/FlinkSqlParserListener.js +1 -1
- package/dist/lib/{flinksql → flink}/FlinkSqlParserVisitor.d.ts +0 -8
- package/dist/lib/{flinksql → flink}/FlinkSqlParserVisitor.js +2 -1
- package/dist/lib/hive/HiveSqlLexer.d.ts +258 -257
- package/dist/lib/hive/HiveSqlLexer.js +1794 -1786
- package/dist/lib/hive/HiveSqlParser.d.ts +1266 -3176
- package/dist/lib/hive/HiveSqlParser.js +23046 -33454
- package/dist/lib/hive/HiveSqlParserListener.d.ts +141 -2036
- package/dist/lib/hive/HiveSqlParserVisitor.d.ts +151 -1358
- package/dist/lib/hive/HiveSqlParserVisitor.js +1 -0
- package/dist/lib/impala/ImpalaSqlLexer.d.ts +170 -154
- package/dist/lib/impala/ImpalaSqlLexer.js +1179 -1099
- package/dist/lib/impala/ImpalaSqlParser.d.ts +282 -240
- package/dist/lib/impala/ImpalaSqlParser.js +3881 -3744
- package/dist/lib/impala/ImpalaSqlParserListener.d.ts +22 -11
- package/dist/lib/impala/ImpalaSqlParserVisitor.d.ts +14 -7
- package/dist/lib/impala/ImpalaSqlParserVisitor.js +1 -0
- package/dist/lib/index.d.ts +6 -6
- package/dist/lib/index.js +6 -6
- package/dist/lib/mysql/MySqlLexer.d.ts +2 -2
- package/dist/lib/mysql/MySqlLexer.js +1 -0
- package/dist/lib/mysql/MySqlParser.d.ts +347 -418
- package/dist/lib/mysql/MySqlParser.js +10484 -11099
- package/dist/lib/mysql/MySqlParserListener.d.ts +41 -126
- package/dist/lib/mysql/MySqlParserVisitor.d.ts +23 -76
- package/dist/lib/mysql/MySqlParserVisitor.js +1 -0
- package/dist/lib/plsql/PlSqlBaseLexer.d.ts +1 -2
- package/dist/lib/plsql/PlSqlBaseLexer.js +1 -1
- package/dist/lib/plsql/PlSqlBaseParser.d.ts +3 -2
- package/dist/lib/plsql/PlSqlBaseParser.js +2 -2
- package/dist/lib/plsql/PlSqlLexer.d.ts +3 -3
- package/dist/lib/plsql/PlSqlLexer.js +2 -1
- package/dist/lib/plsql/PlSqlParser.d.ts +3 -3
- package/dist/lib/plsql/PlSqlParser.js +2 -1
- package/dist/lib/plsql/PlSqlParserVisitor.js +1 -0
- package/dist/lib/{pgsql/PostgreSQLLexer.d.ts → postgresql/PostgreSqlLexer.d.ts} +3 -3
- package/dist/lib/{pgsql/PostgreSQLLexer.js → postgresql/PostgreSqlLexer.js} +618 -617
- package/dist/lib/{pgsql/PostgreSQLParser.d.ts → postgresql/PostgreSqlParser.d.ts} +3598 -3484
- package/dist/lib/{pgsql/PostgreSQLParser.js → postgresql/PostgreSqlParser.js} +41502 -42831
- package/dist/lib/{pgsql/PostgreSQLParserListener.d.ts → postgresql/PostgreSqlParserListener.d.ts} +2797 -2730
- package/dist/lib/{pgsql/PostgreSQLParserListener.js → postgresql/PostgreSqlParserListener.js} +3 -3
- package/dist/lib/{pgsql/PostgreSQLParserVisitor.d.ts → postgresql/PostgreSqlParserVisitor.d.ts} +1845 -1810
- package/dist/lib/{pgsql/PostgreSQLParserVisitor.js → postgresql/PostgreSqlParserVisitor.js} +4 -3
- package/dist/lib/spark/SparkSqlLexer.d.ts +305 -298
- package/dist/lib/spark/SparkSqlLexer.js +1777 -1735
- package/dist/lib/spark/SparkSqlParser.d.ts +1764 -669
- package/dist/lib/spark/SparkSqlParser.js +15460 -10769
- package/dist/lib/spark/SparkSqlParserListener.d.ts +1285 -35
- package/dist/lib/spark/SparkSqlParserVisitor.d.ts +790 -21
- package/dist/lib/spark/SparkSqlParserVisitor.js +1 -0
- package/dist/lib/{trinosql → trino}/TrinoSqlLexer.d.ts +2 -2
- package/dist/lib/{trinosql → trino}/TrinoSqlLexer.js +2 -1
- package/dist/lib/{trinosql → trino}/TrinoSqlListener.d.ts +7 -5
- package/dist/lib/{trinosql → trino}/TrinoSqlListener.js +1 -1
- package/dist/lib/{trinosql → trino}/TrinoSqlParser.d.ts +11 -5
- package/dist/lib/{trinosql → trino}/TrinoSqlParser.js +360 -320
- package/dist/lib/{trinosql → trino}/TrinoSqlVisitor.d.ts +4 -3
- package/dist/lib/{trinosql → trino}/TrinoSqlVisitor.js +2 -1
- package/dist/parser/common/{basicParser.d.ts → basicSQL.d.ts} +22 -19
- package/dist/parser/common/{basicParser.js → basicSQL.js} +52 -34
- package/dist/parser/common/entityCollector.d.ts +78 -0
- package/dist/parser/common/entityCollector.js +191 -0
- package/dist/parser/common/{utils/findCaretTokenIndex.d.ts → findCaretTokenIndex.d.ts} +2 -2
- package/dist/parser/common/{utils/findCaretTokenIndex.js → findCaretTokenIndex.js} +3 -2
- package/dist/parser/common/parseErrorListener.d.ts +6 -6
- package/dist/parser/common/parseErrorListener.js +1 -1
- package/dist/parser/common/simpleStack.d.ts +10 -0
- package/dist/parser/common/simpleStack.js +23 -0
- package/dist/parser/common/splitListener.d.ts +8 -0
- package/dist/parser/common/splitListener.js +12 -0
- package/dist/parser/common/textAndWord.d.ts +52 -0
- package/dist/parser/common/textAndWord.js +58 -0
- package/dist/parser/common/{basic-parser-types.d.ts → types.d.ts} +4 -31
- package/dist/parser/common/types.js +34 -0
- package/dist/parser/flink/flinkEntityCollector.d.ts +33 -0
- package/dist/parser/flink/flinkEntityCollector.js +84 -0
- package/dist/parser/flink/flinkSplitListener.d.ts +6 -0
- package/dist/parser/flink/flinkSplitListener.js +6 -0
- package/dist/parser/flink/index.d.ts +17 -0
- package/dist/parser/{flinksql.js → flink/index.js} +26 -37
- package/dist/parser/hive/hiveEntityCollector.d.ts +35 -0
- package/dist/parser/hive/hiveEntityCollector.js +90 -0
- package/dist/parser/hive/hiveSplitListener.d.ts +6 -0
- package/dist/parser/hive/hiveSplitListener.js +6 -0
- package/dist/parser/hive/index.d.ts +17 -0
- package/dist/parser/{hive.js → hive/index.js} +24 -34
- package/dist/parser/impala/impalaEntityCollector.d.ts +35 -0
- package/dist/parser/impala/impalaEntityCollector.js +90 -0
- package/dist/parser/impala/impalaSplitListener.d.ts +6 -0
- package/dist/parser/impala/impalaSplitListener.js +6 -0
- package/dist/parser/impala/index.d.ts +17 -0
- package/dist/parser/{impala.js → impala/index.js} +24 -34
- package/dist/parser/index.d.ts +8 -8
- package/dist/parser/index.js +8 -8
- package/dist/parser/mysql/index.d.ts +17 -0
- package/dist/parser/{mysql.js → mysql/index.js} +24 -34
- package/dist/parser/mysql/mysqlEntityCollector.d.ts +37 -0
- package/dist/parser/mysql/mysqlEntityCollector.js +96 -0
- package/dist/parser/mysql/mysqlSplitListener.d.ts +6 -0
- package/dist/parser/mysql/mysqlSplitListener.js +6 -0
- package/dist/parser/plsql.d.ts +7 -6
- package/dist/parser/plsql.js +6 -4
- package/dist/parser/postgresql/index.d.ts +17 -0
- package/dist/parser/postgresql/index.js +130 -0
- package/dist/parser/postgresql/postgreEntityCollector.d.ts +37 -0
- package/dist/parser/postgresql/postgreEntityCollector.js +96 -0
- package/dist/parser/postgresql/postgreSplitListener.d.ts +6 -0
- package/dist/parser/postgresql/postgreSplitListener.js +6 -0
- package/dist/parser/spark/index.d.ts +17 -0
- package/dist/parser/{spark.js → spark/index.js} +29 -40
- package/dist/parser/spark/sparkEntityCollector.d.ts +37 -0
- package/dist/parser/spark/sparkEntityCollector.js +96 -0
- package/dist/parser/spark/sparkSplitListener.d.ts +6 -0
- package/dist/parser/spark/sparkSplitListener.js +6 -0
- package/dist/parser/trino/index.d.ts +17 -0
- package/dist/parser/{trinosql.js → trino/index.js} +25 -36
- package/dist/parser/trino/trinoEntityCollector.d.ts +30 -0
- package/dist/parser/trino/trinoEntityCollector.js +75 -0
- package/dist/parser/trino/trinoSplitListener.d.ts +6 -0
- package/dist/parser/trino/trinoSplitListener.js +6 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/token.d.ts +1 -1
- package/package.json +1 -1
- package/dist/parser/common/basic-parser-types.js +0 -34
- package/dist/parser/flinksql.d.ts +0 -23
- package/dist/parser/hive.d.ts +0 -23
- package/dist/parser/impala.d.ts +0 -23
- package/dist/parser/mysql.d.ts +0 -23
- package/dist/parser/pgsql.d.ts +0 -23
- package/dist/parser/pgsql.js +0 -140
- package/dist/parser/spark.d.ts +0 -23
- package/dist/parser/trinosql.d.ts +0 -23
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CharStream, CommonTokenStream, Token } from 'antlr4ng';
|
|
2
|
+
import { CandidatesCollection } from 'antlr4-c3';
|
|
3
|
+
import { HiveSqlLexer } from '../../lib/hive/HiveSqlLexer';
|
|
4
|
+
import { HiveSqlParser, ProgramContext } from '../../lib/hive/HiveSqlParser';
|
|
5
|
+
import { BasicSQL } from '../common/basicSQL';
|
|
6
|
+
import { Suggestions } from '../common/types';
|
|
7
|
+
import { HiveSqlSplitListener } from './hiveSplitListener';
|
|
8
|
+
import { HiveEntityCollector } from './hiveEntityCollector';
|
|
9
|
+
export { HiveEntityCollector, HiveSqlSplitListener };
|
|
10
|
+
export declare class HiveSQL extends BasicSQL<HiveSqlLexer, ProgramContext, HiveSqlParser> {
|
|
11
|
+
protected createLexerFromCharStream(charStreams: CharStream): HiveSqlLexer;
|
|
12
|
+
protected createParserFromTokenStream(tokenStream: CommonTokenStream): HiveSqlParser;
|
|
13
|
+
protected preferredRules: Set<number>;
|
|
14
|
+
protected get splitListener(): HiveSqlSplitListener;
|
|
15
|
+
protected createEntityCollector(input: string, caretTokenIndex?: number): HiveEntityCollector;
|
|
16
|
+
protected processCandidates(candidates: CandidatesCollection, allTokens: Token[], caretTokenIndex: number, tokenIndexOffset: number): Suggestions<Token>;
|
|
17
|
+
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { HiveSqlLexer } from '
|
|
2
|
-
import { HiveSqlParser } from '
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { HiveSqlLexer } from '../../lib/hive/HiveSqlLexer';
|
|
2
|
+
import { HiveSqlParser } from '../../lib/hive/HiveSqlParser';
|
|
3
|
+
import { BasicSQL } from '../common/basicSQL';
|
|
4
|
+
import { EntityContextType } from '../common/types';
|
|
5
|
+
import { HiveSqlSplitListener } from './hiveSplitListener';
|
|
6
|
+
import { HiveEntityCollector } from './hiveEntityCollector';
|
|
7
|
+
export { HiveEntityCollector, HiveSqlSplitListener };
|
|
8
|
+
export class HiveSQL extends BasicSQL {
|
|
6
9
|
constructor() {
|
|
7
10
|
super(...arguments);
|
|
8
11
|
this.preferredRules = new Set([
|
|
@@ -20,8 +23,7 @@ export default class HiveSQL extends BasicParser {
|
|
|
20
23
|
]);
|
|
21
24
|
}
|
|
22
25
|
createLexerFromCharStream(charStreams) {
|
|
23
|
-
|
|
24
|
-
return lexer;
|
|
26
|
+
return new HiveSqlLexer(charStreams);
|
|
25
27
|
}
|
|
26
28
|
createParserFromTokenStream(tokenStream) {
|
|
27
29
|
return new HiveSqlParser(tokenStream);
|
|
@@ -29,6 +31,9 @@ export default class HiveSQL extends BasicParser {
|
|
|
29
31
|
get splitListener() {
|
|
30
32
|
return new HiveSqlSplitListener();
|
|
31
33
|
}
|
|
34
|
+
createEntityCollector(input, caretTokenIndex) {
|
|
35
|
+
return new HiveEntityCollector(input, caretTokenIndex);
|
|
36
|
+
}
|
|
32
37
|
processCandidates(candidates, allTokens, caretTokenIndex, tokenIndexOffset) {
|
|
33
38
|
const originalSyntaxSuggestions = [];
|
|
34
39
|
const keywords = [];
|
|
@@ -36,47 +41,47 @@ export default class HiveSQL extends BasicParser {
|
|
|
36
41
|
const [ruleType, candidateRule] = candidate;
|
|
37
42
|
const startTokenIndex = candidateRule.startTokenIndex + tokenIndexOffset;
|
|
38
43
|
const tokenRanges = allTokens.slice(startTokenIndex, caretTokenIndex + tokenIndexOffset + 1);
|
|
39
|
-
let syntaxContextType;
|
|
44
|
+
let syntaxContextType = void 0;
|
|
40
45
|
switch (ruleType) {
|
|
41
46
|
case HiveSqlParser.RULE_dbSchemaName: {
|
|
42
|
-
syntaxContextType =
|
|
47
|
+
syntaxContextType = EntityContextType.DATABASE;
|
|
43
48
|
break;
|
|
44
49
|
}
|
|
45
50
|
case HiveSqlParser.RULE_dbSchemaNameCreate: {
|
|
46
|
-
syntaxContextType =
|
|
51
|
+
syntaxContextType = EntityContextType.DATABASE_CREATE;
|
|
47
52
|
break;
|
|
48
53
|
}
|
|
49
54
|
case HiveSqlParser.RULE_tableName: {
|
|
50
|
-
syntaxContextType =
|
|
55
|
+
syntaxContextType = EntityContextType.TABLE;
|
|
51
56
|
break;
|
|
52
57
|
}
|
|
53
58
|
case HiveSqlParser.RULE_tableNameCreate: {
|
|
54
|
-
syntaxContextType =
|
|
59
|
+
syntaxContextType = EntityContextType.TABLE_CREATE;
|
|
55
60
|
break;
|
|
56
61
|
}
|
|
57
62
|
case HiveSqlParser.RULE_viewName: {
|
|
58
|
-
syntaxContextType =
|
|
63
|
+
syntaxContextType = EntityContextType.VIEW;
|
|
59
64
|
break;
|
|
60
65
|
}
|
|
61
66
|
case HiveSqlParser.RULE_viewNameCreate: {
|
|
62
|
-
syntaxContextType =
|
|
67
|
+
syntaxContextType = EntityContextType.VIEW_CREATE;
|
|
63
68
|
break;
|
|
64
69
|
}
|
|
65
70
|
case HiveSqlParser.RULE_functionNameForDDL:
|
|
66
71
|
case HiveSqlParser.RULE_functionNameForInvoke: {
|
|
67
|
-
syntaxContextType =
|
|
72
|
+
syntaxContextType = EntityContextType.FUNCTION;
|
|
68
73
|
break;
|
|
69
74
|
}
|
|
70
75
|
case HiveSqlParser.RULE_functionNameCreate: {
|
|
71
|
-
syntaxContextType =
|
|
76
|
+
syntaxContextType = EntityContextType.FUNCTION_CREATE;
|
|
72
77
|
break;
|
|
73
78
|
}
|
|
74
79
|
case HiveSqlParser.RULE_columnName: {
|
|
75
|
-
syntaxContextType =
|
|
80
|
+
syntaxContextType = EntityContextType.COLUMN;
|
|
76
81
|
break;
|
|
77
82
|
}
|
|
78
83
|
case HiveSqlParser.RULE_columnNameCreate: {
|
|
79
|
-
syntaxContextType =
|
|
84
|
+
syntaxContextType = EntityContextType.COLUMN_CREATE;
|
|
80
85
|
break;
|
|
81
86
|
}
|
|
82
87
|
default:
|
|
@@ -92,7 +97,7 @@ export default class HiveSQL extends BasicParser {
|
|
|
92
97
|
for (let candidate of candidates.tokens) {
|
|
93
98
|
const symbolicName = this._parser.vocabulary.getSymbolicName(candidate[0]);
|
|
94
99
|
const displayName = this._parser.vocabulary.getDisplayName(candidate[0]);
|
|
95
|
-
if (symbolicName && symbolicName.startsWith('KW_')) {
|
|
100
|
+
if (displayName && symbolicName && symbolicName.startsWith('KW_')) {
|
|
96
101
|
const keyword = displayName.startsWith("'") && displayName.endsWith("'")
|
|
97
102
|
? displayName.slice(1, -1)
|
|
98
103
|
: displayName;
|
|
@@ -105,18 +110,3 @@ export default class HiveSQL extends BasicParser {
|
|
|
105
110
|
};
|
|
106
111
|
}
|
|
107
112
|
}
|
|
108
|
-
export class HiveSqlSplitListener {
|
|
109
|
-
constructor() {
|
|
110
|
-
this._statementContext = [];
|
|
111
|
-
this.exitStatement = (ctx) => {
|
|
112
|
-
this._statementContext.push(ctx);
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
visitTerminal() { }
|
|
116
|
-
visitErrorNode() { }
|
|
117
|
-
enterEveryRule() { }
|
|
118
|
-
exitEveryRule() { }
|
|
119
|
-
get statementsContext() {
|
|
120
|
-
return this._statementContext;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ImpalaSqlParserListener } from '../../lib';
|
|
2
|
+
import { ColumnNamePathCreateContext, CreateAggregateFunctionContext, CreateFunctionContext, CreateKuduTableAsSelectContext, CreateSchemaContext, CreateTableLikeContext, CreateTableSelectContext, CreateViewContext, DatabaseNameCreateContext, DatabaseNamePathContext, FunctionNameCreateContext, InsertStatementContext, QueryStatementContext, SingleStatementContext, TableNameCreateContext, TableNamePathContext, ViewNameCreateContext, ViewNamePathContext } from '../../lib/impala/ImpalaSqlParser';
|
|
3
|
+
import { EntityCollector } from '../common/entityCollector';
|
|
4
|
+
export declare class ImpalaEntityCollector extends EntityCollector implements ImpalaSqlParserListener {
|
|
5
|
+
/** ===== Entity begin */
|
|
6
|
+
exitTableNameCreate(ctx: TableNameCreateContext): void;
|
|
7
|
+
exitTableNamePath(ctx: TableNamePathContext): void;
|
|
8
|
+
exitColumnNamePathCreate(ctx: ColumnNamePathCreateContext): void;
|
|
9
|
+
exitViewNameCreate(ctx: ViewNameCreateContext): void;
|
|
10
|
+
exitViewNamePath(ctx: ViewNamePathContext): void;
|
|
11
|
+
exitDatabaseNamePath(ctx: DatabaseNamePathContext): void;
|
|
12
|
+
exitDatabaseNameCreate(ctx: DatabaseNameCreateContext): void;
|
|
13
|
+
exitFunctionNameCreate(ctx: FunctionNameCreateContext): void;
|
|
14
|
+
/** ===== Statement begin */
|
|
15
|
+
enterSingleStatement(ctx: SingleStatementContext): void;
|
|
16
|
+
exitSingleStatement(ctx: SingleStatementContext): void;
|
|
17
|
+
enterCreateTableLike(ctx: CreateTableLikeContext): void;
|
|
18
|
+
exitCreateTableLike(ctx: CreateTableLikeContext): void;
|
|
19
|
+
enterCreateTableSelect(ctx: CreateTableSelectContext): void;
|
|
20
|
+
exitCreateTableSelect(ctx: CreateTableSelectContext): void;
|
|
21
|
+
enterCreateKuduTableAsSelect(ctx: CreateKuduTableAsSelectContext): void;
|
|
22
|
+
exitCreateKuduTableAsSelect(ctx: CreateKuduTableAsSelectContext): void;
|
|
23
|
+
enterQueryStatement(ctx: QueryStatementContext): void;
|
|
24
|
+
exitQueryStatement(ctx: QueryStatementContext): void;
|
|
25
|
+
enterCreateView(ctx: CreateViewContext): void;
|
|
26
|
+
exitCreateView(ctx: CreateViewContext): void;
|
|
27
|
+
enterInsertStatement(ctx: InsertStatementContext): void;
|
|
28
|
+
exitInsertStatement(ctx: InsertStatementContext): void;
|
|
29
|
+
enterCreateSchema(ctx: CreateSchemaContext): void;
|
|
30
|
+
exitCreateSchema(ctx: CreateSchemaContext): void;
|
|
31
|
+
enterCreateAggregateFunction(ctx: CreateAggregateFunctionContext): void;
|
|
32
|
+
exitCreateAggregateFunction(ctx: CreateAggregateFunctionContext): void;
|
|
33
|
+
enterCreateFunction(ctx: CreateFunctionContext): void;
|
|
34
|
+
exitCreateFunction(ctx: CreateFunctionContext): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { EntityContextType } from '../common/types';
|
|
2
|
+
import { StmtContextType, EntityCollector } from '../common/entityCollector';
|
|
3
|
+
export class ImpalaEntityCollector extends EntityCollector {
|
|
4
|
+
/** ===== Entity begin */
|
|
5
|
+
exitTableNameCreate(ctx) {
|
|
6
|
+
this.pushEntity(ctx, EntityContextType.TABLE_CREATE);
|
|
7
|
+
}
|
|
8
|
+
exitTableNamePath(ctx) {
|
|
9
|
+
this.pushEntity(ctx, EntityContextType.TABLE);
|
|
10
|
+
}
|
|
11
|
+
exitColumnNamePathCreate(ctx) {
|
|
12
|
+
this.pushEntity(ctx, EntityContextType.COLUMN_CREATE);
|
|
13
|
+
}
|
|
14
|
+
exitViewNameCreate(ctx) {
|
|
15
|
+
this.pushEntity(ctx, EntityContextType.VIEW_CREATE);
|
|
16
|
+
}
|
|
17
|
+
exitViewNamePath(ctx) {
|
|
18
|
+
this.pushEntity(ctx, EntityContextType.VIEW);
|
|
19
|
+
}
|
|
20
|
+
exitDatabaseNamePath(ctx) {
|
|
21
|
+
this.pushEntity(ctx, EntityContextType.DATABASE);
|
|
22
|
+
}
|
|
23
|
+
exitDatabaseNameCreate(ctx) {
|
|
24
|
+
this.pushEntity(ctx, EntityContextType.DATABASE_CREATE);
|
|
25
|
+
}
|
|
26
|
+
exitFunctionNameCreate(ctx) {
|
|
27
|
+
this.pushEntity(ctx, EntityContextType.FUNCTION_CREATE);
|
|
28
|
+
}
|
|
29
|
+
/** ===== Statement begin */
|
|
30
|
+
enterSingleStatement(ctx) {
|
|
31
|
+
this.pushStmt(ctx, StmtContextType.COMMON_STMT);
|
|
32
|
+
}
|
|
33
|
+
exitSingleStatement(ctx) {
|
|
34
|
+
this.popStmt();
|
|
35
|
+
}
|
|
36
|
+
enterCreateTableLike(ctx) {
|
|
37
|
+
this.pushStmt(ctx, StmtContextType.CREATE_TABLE_STMT);
|
|
38
|
+
}
|
|
39
|
+
exitCreateTableLike(ctx) {
|
|
40
|
+
this.popStmt();
|
|
41
|
+
}
|
|
42
|
+
enterCreateTableSelect(ctx) {
|
|
43
|
+
this.pushStmt(ctx, StmtContextType.CREATE_TABLE_STMT);
|
|
44
|
+
}
|
|
45
|
+
exitCreateTableSelect(ctx) {
|
|
46
|
+
this.popStmt();
|
|
47
|
+
}
|
|
48
|
+
enterCreateKuduTableAsSelect(ctx) {
|
|
49
|
+
this.pushStmt(ctx, StmtContextType.CREATE_TABLE_STMT);
|
|
50
|
+
}
|
|
51
|
+
exitCreateKuduTableAsSelect(ctx) {
|
|
52
|
+
this.popStmt();
|
|
53
|
+
}
|
|
54
|
+
enterQueryStatement(ctx) {
|
|
55
|
+
this.pushStmt(ctx, StmtContextType.SELECT_STMT);
|
|
56
|
+
}
|
|
57
|
+
exitQueryStatement(ctx) {
|
|
58
|
+
this.popStmt();
|
|
59
|
+
}
|
|
60
|
+
enterCreateView(ctx) {
|
|
61
|
+
this.pushStmt(ctx, StmtContextType.CREATE_VIEW_STMT);
|
|
62
|
+
}
|
|
63
|
+
exitCreateView(ctx) {
|
|
64
|
+
this.popStmt();
|
|
65
|
+
}
|
|
66
|
+
enterInsertStatement(ctx) {
|
|
67
|
+
this.pushStmt(ctx, StmtContextType.INSERT_STMT);
|
|
68
|
+
}
|
|
69
|
+
exitInsertStatement(ctx) {
|
|
70
|
+
this.popStmt();
|
|
71
|
+
}
|
|
72
|
+
enterCreateSchema(ctx) {
|
|
73
|
+
this.pushStmt(ctx, StmtContextType.CREATE_DATABASE_STMT);
|
|
74
|
+
}
|
|
75
|
+
exitCreateSchema(ctx) {
|
|
76
|
+
this.popStmt();
|
|
77
|
+
}
|
|
78
|
+
enterCreateAggregateFunction(ctx) {
|
|
79
|
+
this.pushStmt(ctx, StmtContextType.CREATE_FUNCTION_STMT);
|
|
80
|
+
}
|
|
81
|
+
exitCreateAggregateFunction(ctx) {
|
|
82
|
+
this.popStmt();
|
|
83
|
+
}
|
|
84
|
+
enterCreateFunction(ctx) {
|
|
85
|
+
this.pushStmt(ctx, StmtContextType.CREATE_FUNCTION_STMT);
|
|
86
|
+
}
|
|
87
|
+
exitCreateFunction(ctx) {
|
|
88
|
+
this.popStmt();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SingleStatementContext } from '../../lib/impala/ImpalaSqlParser';
|
|
2
|
+
import { ImpalaSqlParserListener } from '../../lib/impala/ImpalaSqlParserListener';
|
|
3
|
+
import { SplitListener } from '../common/splitListener';
|
|
4
|
+
export declare class ImpalaSqlSplitListener extends SplitListener<SingleStatementContext> implements ImpalaSqlParserListener {
|
|
5
|
+
exitSingleStatement(ctx: SingleStatementContext): void;
|
|
6
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CharStream, CommonTokenStream, Token } from 'antlr4ng';
|
|
2
|
+
import { CandidatesCollection } from 'antlr4-c3';
|
|
3
|
+
import { ImpalaSqlLexer } from '../../lib/impala/ImpalaSqlLexer';
|
|
4
|
+
import { ImpalaSqlParser, ProgramContext } from '../../lib/impala/ImpalaSqlParser';
|
|
5
|
+
import { BasicSQL } from '../common/basicSQL';
|
|
6
|
+
import { Suggestions } from '../common/types';
|
|
7
|
+
import { ImpalaSqlSplitListener } from './impalaSplitListener';
|
|
8
|
+
import { ImpalaEntityCollector } from './impalaEntityCollector';
|
|
9
|
+
export { ImpalaEntityCollector, ImpalaSqlSplitListener };
|
|
10
|
+
export declare class ImpalaSQL extends BasicSQL<ImpalaSqlLexer, ProgramContext, ImpalaSqlParser> {
|
|
11
|
+
protected createLexerFromCharStream(charStreams: CharStream): ImpalaSqlLexer;
|
|
12
|
+
protected createParserFromTokenStream(tokenStream: CommonTokenStream): ImpalaSqlParser;
|
|
13
|
+
protected preferredRules: Set<number>;
|
|
14
|
+
protected get splitListener(): ImpalaSqlSplitListener;
|
|
15
|
+
protected createEntityCollector(input: string, caretTokenIndex?: number): ImpalaEntityCollector;
|
|
16
|
+
protected processCandidates(candidates: CandidatesCollection, allTokens: Token[], caretTokenIndex: number, tokenIndexOffset: number): Suggestions<Token>;
|
|
17
|
+
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { ImpalaSqlLexer } from '
|
|
2
|
-
import { ImpalaSqlParser
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { ImpalaSqlLexer } from '../../lib/impala/ImpalaSqlLexer';
|
|
2
|
+
import { ImpalaSqlParser } from '../../lib/impala/ImpalaSqlParser';
|
|
3
|
+
import { BasicSQL } from '../common/basicSQL';
|
|
4
|
+
import { EntityContextType } from '../common/types';
|
|
5
|
+
import { ImpalaSqlSplitListener } from './impalaSplitListener';
|
|
6
|
+
import { ImpalaEntityCollector } from './impalaEntityCollector';
|
|
7
|
+
export { ImpalaEntityCollector, ImpalaSqlSplitListener };
|
|
8
|
+
export class ImpalaSQL extends BasicSQL {
|
|
6
9
|
constructor() {
|
|
7
10
|
super(...arguments);
|
|
8
11
|
this.preferredRules = new Set([
|
|
@@ -19,8 +22,7 @@ export default class ImpalaSQL extends BasicParser {
|
|
|
19
22
|
]);
|
|
20
23
|
}
|
|
21
24
|
createLexerFromCharStream(charStreams) {
|
|
22
|
-
|
|
23
|
-
return lexer;
|
|
25
|
+
return new ImpalaSqlLexer(charStreams);
|
|
24
26
|
}
|
|
25
27
|
createParserFromTokenStream(tokenStream) {
|
|
26
28
|
return new ImpalaSqlParser(tokenStream);
|
|
@@ -28,6 +30,9 @@ export default class ImpalaSQL extends BasicParser {
|
|
|
28
30
|
get splitListener() {
|
|
29
31
|
return new ImpalaSqlSplitListener();
|
|
30
32
|
}
|
|
33
|
+
createEntityCollector(input, caretTokenIndex) {
|
|
34
|
+
return new ImpalaEntityCollector(input, caretTokenIndex);
|
|
35
|
+
}
|
|
31
36
|
processCandidates(candidates, allTokens, caretTokenIndex, tokenIndexOffset) {
|
|
32
37
|
const originalSyntaxSuggestions = [];
|
|
33
38
|
const keywords = [];
|
|
@@ -35,46 +40,46 @@ export default class ImpalaSQL extends BasicParser {
|
|
|
35
40
|
const [ruleType, candidateRule] = candidate;
|
|
36
41
|
const startTokenIndex = candidateRule.startTokenIndex + tokenIndexOffset;
|
|
37
42
|
const tokenRanges = allTokens.slice(startTokenIndex, caretTokenIndex + tokenIndexOffset + 1);
|
|
38
|
-
let syntaxContextType;
|
|
43
|
+
let syntaxContextType = void 0;
|
|
39
44
|
switch (ruleType) {
|
|
40
45
|
case ImpalaSqlParser.RULE_functionNameCreate: {
|
|
41
|
-
syntaxContextType =
|
|
46
|
+
syntaxContextType = EntityContextType.FUNCTION_CREATE;
|
|
42
47
|
break;
|
|
43
48
|
}
|
|
44
49
|
case ImpalaSqlParser.RULE_tableNameCreate: {
|
|
45
|
-
syntaxContextType =
|
|
50
|
+
syntaxContextType = EntityContextType.TABLE_CREATE;
|
|
46
51
|
break;
|
|
47
52
|
}
|
|
48
53
|
case ImpalaSqlParser.RULE_databaseNameCreate: {
|
|
49
|
-
syntaxContextType =
|
|
54
|
+
syntaxContextType = EntityContextType.DATABASE_CREATE;
|
|
50
55
|
break;
|
|
51
56
|
}
|
|
52
57
|
case ImpalaSqlParser.RULE_viewNameCreate: {
|
|
53
|
-
syntaxContextType =
|
|
58
|
+
syntaxContextType = EntityContextType.VIEW_CREATE;
|
|
54
59
|
break;
|
|
55
60
|
}
|
|
56
61
|
case ImpalaSqlParser.RULE_columnNamePathCreate: {
|
|
57
|
-
syntaxContextType =
|
|
62
|
+
syntaxContextType = EntityContextType.COLUMN_CREATE;
|
|
58
63
|
break;
|
|
59
64
|
}
|
|
60
65
|
case ImpalaSqlParser.RULE_databaseNamePath: {
|
|
61
|
-
syntaxContextType =
|
|
66
|
+
syntaxContextType = EntityContextType.DATABASE;
|
|
62
67
|
break;
|
|
63
68
|
}
|
|
64
69
|
case ImpalaSqlParser.RULE_tableNamePath: {
|
|
65
|
-
syntaxContextType =
|
|
70
|
+
syntaxContextType = EntityContextType.TABLE;
|
|
66
71
|
break;
|
|
67
72
|
}
|
|
68
73
|
case ImpalaSqlParser.RULE_viewNamePath: {
|
|
69
|
-
syntaxContextType =
|
|
74
|
+
syntaxContextType = EntityContextType.VIEW;
|
|
70
75
|
break;
|
|
71
76
|
}
|
|
72
77
|
case ImpalaSqlParser.RULE_functionNamePath: {
|
|
73
|
-
syntaxContextType =
|
|
78
|
+
syntaxContextType = EntityContextType.FUNCTION;
|
|
74
79
|
break;
|
|
75
80
|
}
|
|
76
81
|
case ImpalaSqlParser.RULE_columnNamePath: {
|
|
77
|
-
syntaxContextType =
|
|
82
|
+
syntaxContextType = EntityContextType.COLUMN;
|
|
78
83
|
}
|
|
79
84
|
default:
|
|
80
85
|
break;
|
|
@@ -89,7 +94,7 @@ export default class ImpalaSQL extends BasicParser {
|
|
|
89
94
|
for (let candidate of candidates.tokens) {
|
|
90
95
|
const symbolicName = this._parser.vocabulary.getSymbolicName(candidate[0]);
|
|
91
96
|
const displayName = this._parser.vocabulary.getDisplayName(candidate[0]);
|
|
92
|
-
if (symbolicName && symbolicName.startsWith('KW_')) {
|
|
97
|
+
if (displayName && symbolicName && symbolicName.startsWith('KW_')) {
|
|
93
98
|
const keyword = displayName.startsWith("'") && displayName.endsWith("'")
|
|
94
99
|
? displayName.slice(1, -1)
|
|
95
100
|
: displayName;
|
|
@@ -102,18 +107,3 @@ export default class ImpalaSQL extends BasicParser {
|
|
|
102
107
|
};
|
|
103
108
|
}
|
|
104
109
|
}
|
|
105
|
-
export class ImpalaSqlSplitListener {
|
|
106
|
-
constructor() {
|
|
107
|
-
this._statementContext = [];
|
|
108
|
-
this.exitSingleStatement = (ctx) => {
|
|
109
|
-
this._statementContext.push(ctx);
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
visitTerminal() { }
|
|
113
|
-
visitErrorNode() { }
|
|
114
|
-
enterEveryRule() { }
|
|
115
|
-
exitEveryRule() { }
|
|
116
|
-
get statementsContext() {
|
|
117
|
-
return this._statementContext;
|
|
118
|
-
}
|
|
119
|
-
}
|
package/dist/parser/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
1
|
+
export { MySQL } from './mysql';
|
|
2
|
+
export { PLSQL } from './plsql';
|
|
3
|
+
export { HiveSQL } from './hive';
|
|
4
|
+
export { FlinkSQL } from './flink';
|
|
5
|
+
export { SparkSQL } from './spark';
|
|
6
|
+
export { PostgreSQL } from './postgresql';
|
|
7
|
+
export { TrinoSQL } from './trino';
|
|
8
|
+
export { ImpalaSQL } from './impala';
|
package/dist/parser/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
1
|
+
export { MySQL } from './mysql';
|
|
2
|
+
export { PLSQL } from './plsql';
|
|
3
|
+
export { HiveSQL } from './hive';
|
|
4
|
+
export { FlinkSQL } from './flink';
|
|
5
|
+
export { SparkSQL } from './spark';
|
|
6
|
+
export { PostgreSQL } from './postgresql';
|
|
7
|
+
export { TrinoSQL } from './trino';
|
|
8
|
+
export { ImpalaSQL } from './impala';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CharStream, CommonTokenStream, Token } from 'antlr4ng';
|
|
2
|
+
import { CandidatesCollection } from 'antlr4-c3';
|
|
3
|
+
import { MySqlLexer } from '../../lib/mysql/MySqlLexer';
|
|
4
|
+
import { MySqlParser, ProgramContext } from '../../lib/mysql/MySqlParser';
|
|
5
|
+
import { BasicSQL } from '../common/basicSQL';
|
|
6
|
+
import { Suggestions } from '../common/types';
|
|
7
|
+
import { MysqlSplitListener } from './mysqlSplitListener';
|
|
8
|
+
import { MySqlEntityCollector } from './mysqlEntityCollector';
|
|
9
|
+
export { MySqlEntityCollector, MysqlSplitListener };
|
|
10
|
+
export declare class MySQL extends BasicSQL<MySqlLexer, ProgramContext, MySqlParser> {
|
|
11
|
+
protected createLexerFromCharStream(charStreams: CharStream): MySqlLexer;
|
|
12
|
+
protected createParserFromTokenStream(tokenStream: CommonTokenStream): MySqlParser;
|
|
13
|
+
protected preferredRules: Set<number>;
|
|
14
|
+
protected get splitListener(): MysqlSplitListener;
|
|
15
|
+
protected createEntityCollector(input: string, caretTokenIndex?: number): MySqlEntityCollector;
|
|
16
|
+
protected processCandidates(candidates: CandidatesCollection, allTokens: Token[], caretTokenIndex: number, tokenIndexOffset: number): Suggestions<Token>;
|
|
17
|
+
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { MySqlLexer } from '
|
|
2
|
-
import { MySqlParser } from '
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { MySqlLexer } from '../../lib/mysql/MySqlLexer';
|
|
2
|
+
import { MySqlParser } from '../../lib/mysql/MySqlParser';
|
|
3
|
+
import { BasicSQL } from '../common/basicSQL';
|
|
4
|
+
import { EntityContextType } from '../common/types';
|
|
5
|
+
import { MysqlSplitListener } from './mysqlSplitListener';
|
|
6
|
+
import { MySqlEntityCollector } from './mysqlEntityCollector';
|
|
7
|
+
export { MySqlEntityCollector, MysqlSplitListener };
|
|
8
|
+
export class MySQL extends BasicSQL {
|
|
6
9
|
constructor() {
|
|
7
10
|
super(...arguments);
|
|
8
11
|
this.preferredRules = new Set([
|
|
@@ -19,8 +22,7 @@ export default class MySQL extends BasicParser {
|
|
|
19
22
|
]);
|
|
20
23
|
}
|
|
21
24
|
createLexerFromCharStream(charStreams) {
|
|
22
|
-
|
|
23
|
-
return lexer;
|
|
25
|
+
return new MySqlLexer(charStreams);
|
|
24
26
|
}
|
|
25
27
|
createParserFromTokenStream(tokenStream) {
|
|
26
28
|
return new MySqlParser(tokenStream);
|
|
@@ -28,6 +30,9 @@ export default class MySQL extends BasicParser {
|
|
|
28
30
|
get splitListener() {
|
|
29
31
|
return new MysqlSplitListener();
|
|
30
32
|
}
|
|
33
|
+
createEntityCollector(input, caretTokenIndex) {
|
|
34
|
+
return new MySqlEntityCollector(input, caretTokenIndex);
|
|
35
|
+
}
|
|
31
36
|
processCandidates(candidates, allTokens, caretTokenIndex, tokenIndexOffset) {
|
|
32
37
|
const originalSyntaxSuggestions = [];
|
|
33
38
|
const keywords = [];
|
|
@@ -35,46 +40,46 @@ export default class MySQL extends BasicParser {
|
|
|
35
40
|
const [ruleType, candidateRule] = candidate;
|
|
36
41
|
const startTokenIndex = candidateRule.startTokenIndex + tokenIndexOffset;
|
|
37
42
|
const tokenRanges = allTokens.slice(startTokenIndex, caretTokenIndex + tokenIndexOffset + 1);
|
|
38
|
-
let syntaxContextType;
|
|
43
|
+
let syntaxContextType = void 0;
|
|
39
44
|
switch (ruleType) {
|
|
40
45
|
case MySqlParser.RULE_databaseName: {
|
|
41
|
-
syntaxContextType =
|
|
46
|
+
syntaxContextType = EntityContextType.DATABASE;
|
|
42
47
|
break;
|
|
43
48
|
}
|
|
44
49
|
case MySqlParser.RULE_databaseNameCreate: {
|
|
45
|
-
syntaxContextType =
|
|
50
|
+
syntaxContextType = EntityContextType.DATABASE_CREATE;
|
|
46
51
|
break;
|
|
47
52
|
}
|
|
48
53
|
case MySqlParser.RULE_tableName: {
|
|
49
|
-
syntaxContextType =
|
|
54
|
+
syntaxContextType = EntityContextType.TABLE;
|
|
50
55
|
break;
|
|
51
56
|
}
|
|
52
57
|
case MySqlParser.RULE_tableNameCreate: {
|
|
53
|
-
syntaxContextType =
|
|
58
|
+
syntaxContextType = EntityContextType.TABLE_CREATE;
|
|
54
59
|
break;
|
|
55
60
|
}
|
|
56
61
|
case MySqlParser.RULE_viewName: {
|
|
57
|
-
syntaxContextType =
|
|
62
|
+
syntaxContextType = EntityContextType.VIEW;
|
|
58
63
|
break;
|
|
59
64
|
}
|
|
60
65
|
case MySqlParser.RULE_viewNameCreate: {
|
|
61
|
-
syntaxContextType =
|
|
66
|
+
syntaxContextType = EntityContextType.VIEW_CREATE;
|
|
62
67
|
break;
|
|
63
68
|
}
|
|
64
69
|
case MySqlParser.RULE_functionName: {
|
|
65
|
-
syntaxContextType =
|
|
70
|
+
syntaxContextType = EntityContextType.FUNCTION;
|
|
66
71
|
break;
|
|
67
72
|
}
|
|
68
73
|
case MySqlParser.RULE_functionNameCreate: {
|
|
69
|
-
syntaxContextType =
|
|
74
|
+
syntaxContextType = EntityContextType.FUNCTION_CREATE;
|
|
70
75
|
break;
|
|
71
76
|
}
|
|
72
77
|
case MySqlParser.RULE_columnName: {
|
|
73
|
-
syntaxContextType =
|
|
78
|
+
syntaxContextType = EntityContextType.COLUMN;
|
|
74
79
|
break;
|
|
75
80
|
}
|
|
76
81
|
case MySqlParser.RULE_columnNameCreate: {
|
|
77
|
-
syntaxContextType =
|
|
82
|
+
syntaxContextType = EntityContextType.COLUMN_CREATE;
|
|
78
83
|
break;
|
|
79
84
|
}
|
|
80
85
|
default:
|
|
@@ -90,7 +95,7 @@ export default class MySQL extends BasicParser {
|
|
|
90
95
|
for (const candidate of candidates.tokens) {
|
|
91
96
|
const symbolicName = this._parser.vocabulary.getSymbolicName(candidate[0]);
|
|
92
97
|
const displayName = this._parser.vocabulary.getDisplayName(candidate[0]);
|
|
93
|
-
if (symbolicName && symbolicName.startsWith('KW_')) {
|
|
98
|
+
if (displayName && symbolicName && symbolicName.startsWith('KW_')) {
|
|
94
99
|
const keyword = displayName.startsWith("'") && displayName.endsWith("'")
|
|
95
100
|
? displayName.slice(1, -1)
|
|
96
101
|
: displayName;
|
|
@@ -103,18 +108,3 @@ export default class MySQL extends BasicParser {
|
|
|
103
108
|
};
|
|
104
109
|
}
|
|
105
110
|
}
|
|
106
|
-
export class MysqlSplitListener {
|
|
107
|
-
constructor() {
|
|
108
|
-
this._statementsContext = [];
|
|
109
|
-
this.exitSingleStatement = (ctx) => {
|
|
110
|
-
this._statementsContext.push(ctx);
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
visitTerminal() { }
|
|
114
|
-
visitErrorNode() { }
|
|
115
|
-
enterEveryRule() { }
|
|
116
|
-
exitEveryRule() { }
|
|
117
|
-
get statementsContext() {
|
|
118
|
-
return this._statementsContext;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ColumnCreateTableContext, ColumnNameCreateContext, CopyCreateTableContext, CreateDatabaseContext, CreateFunctionContext, CreateViewContext, DatabaseNameContext, DatabaseNameCreateContext, FunctionNameCreateContext, InsertStatementContext, QueryCreateTableContext, SelectStatementContext, SingleStatementContext, TableNameContext, TableNameCreateContext, ViewNameContext, ViewNameCreateContext } from '../../lib/mysql/MySqlParser';
|
|
2
|
+
import type { MySqlParserListener } from '../../lib/mysql/MySqlParserListener';
|
|
3
|
+
import { EntityCollector } from '../common/entityCollector';
|
|
4
|
+
export declare class MySqlEntityCollector extends EntityCollector implements MySqlParserListener {
|
|
5
|
+
/** ====== Entity Begin */
|
|
6
|
+
exitDatabaseName(ctx: DatabaseNameContext): void;
|
|
7
|
+
exitDatabaseNameCreate(ctx: DatabaseNameCreateContext): void;
|
|
8
|
+
exitTableName(ctx: TableNameContext): void;
|
|
9
|
+
exitTableNameCreate(ctx: TableNameCreateContext): void;
|
|
10
|
+
exitViewName(ctx: ViewNameContext): void;
|
|
11
|
+
exitViewNameCreate(ctx: ViewNameCreateContext): void;
|
|
12
|
+
exitFunctionNameCreate(ctx: FunctionNameCreateContext): void;
|
|
13
|
+
exitColumnNameCreate(ctx: ColumnNameCreateContext): void;
|
|
14
|
+
/** ===== Statement begin */
|
|
15
|
+
enterSingleStatement(ctx: SingleStatementContext): void;
|
|
16
|
+
exitSingleStatement(ctx: SingleStatementContext): void;
|
|
17
|
+
enterQueryCreateTable(ctx: QueryCreateTableContext): void;
|
|
18
|
+
exitQueryCreateTable(ctx: QueryCreateTableContext): void;
|
|
19
|
+
enterColumnCreateTable(ctx: ColumnCreateTableContext): void;
|
|
20
|
+
exitColumnCreateTable(ctx: ColumnCreateTableContext): void;
|
|
21
|
+
enterCopyCreateTable(ctx: CopyCreateTableContext): void;
|
|
22
|
+
exitCopyCreateTable(ctx: CopyCreateTableContext): void;
|
|
23
|
+
enterCreateView(ctx: CreateViewContext): void;
|
|
24
|
+
exitCreateView(ctx: CreateViewContext): void;
|
|
25
|
+
enterSimpleSelect(ctx: SelectStatementContext): void;
|
|
26
|
+
exitSimpleSelect(ctx: SelectStatementContext): void;
|
|
27
|
+
enterUnionAndLateralSelect(ctx: SelectStatementContext): void;
|
|
28
|
+
exitUnionAndLateralSelect(ctx: SelectStatementContext): void;
|
|
29
|
+
enterSelectExpression(ctx: SelectStatementContext): void;
|
|
30
|
+
exitSelectExpression(ctx: SelectStatementContext): void;
|
|
31
|
+
enterInsertStatement(ctx: InsertStatementContext): void;
|
|
32
|
+
exitInsertStatement(ctx: InsertStatementContext): void;
|
|
33
|
+
enterCreateDatabase(ctx: CreateDatabaseContext): void;
|
|
34
|
+
exitCreateDatabase(ctx: CreateDatabaseContext): void;
|
|
35
|
+
enterCreateFunction(ctx: CreateFunctionContext): void;
|
|
36
|
+
exitCreateFunction(ctx: CreateFunctionContext): void;
|
|
37
|
+
}
|