dt-sql-parser 4.2.0 → 4.3.1
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.
|
@@ -266,7 +266,7 @@ export class BasicSQL {
|
|
|
266
266
|
}
|
|
267
267
|
// A boundary consisting of the index of the input.
|
|
268
268
|
const startIndex = (_e = (_d = startStatement === null || startStatement === void 0 ? void 0 : startStatement.start) === null || _d === void 0 ? void 0 : _d.start) !== null && _e !== void 0 ? _e : 0;
|
|
269
|
-
const stopIndex = (_g = (_f = stopStatement === null || stopStatement === void 0 ? void 0 : stopStatement.stop) === null || _f === void 0 ? void 0 : _f.stop) !== null && _g !== void 0 ? _g : inputSlice.length
|
|
269
|
+
const stopIndex = (_g = (_f = stopStatement === null || stopStatement === void 0 ? void 0 : stopStatement.stop) === null || _f === void 0 ? void 0 : _f.stop) !== null && _g !== void 0 ? _g : inputSlice.length;
|
|
270
270
|
/**
|
|
271
271
|
* Save offset of the tokenIndex in the range of input
|
|
272
272
|
* compared to the tokenIndex in the whole input
|
|
@@ -343,6 +343,7 @@ export class BasicSQL {
|
|
|
343
343
|
else {
|
|
344
344
|
if (statementCount > 1) {
|
|
345
345
|
caretTokenIndex = caretTokenIndex - tokenIndexOffset;
|
|
346
|
+
allTokens = allTokens.slice(tokenIndexOffset);
|
|
346
347
|
}
|
|
347
348
|
}
|
|
348
349
|
let sqlParserIns = this._parser;
|
|
@@ -41,7 +41,11 @@ export declare enum EntityContextType {
|
|
|
41
41
|
/** column name */
|
|
42
42
|
COLUMN = "column",
|
|
43
43
|
/** column name that will be created */
|
|
44
|
-
COLUMN_CREATE = "columnCreate"
|
|
44
|
+
COLUMN_CREATE = "columnCreate",
|
|
45
|
+
/** table property key when creating table*/
|
|
46
|
+
TABLE_PROPERTY_KEY = "tablePropertyKey",
|
|
47
|
+
/** table property value when creating table*/
|
|
48
|
+
TABLE_PROPERTY_VALUE = "tablePropertyValue"
|
|
45
49
|
}
|
|
46
50
|
/**
|
|
47
51
|
* Suggested information analyzed from the input
|
|
@@ -31,6 +31,10 @@ export var EntityContextType;
|
|
|
31
31
|
EntityContextType["COLUMN"] = "column";
|
|
32
32
|
/** column name that will be created */
|
|
33
33
|
EntityContextType["COLUMN_CREATE"] = "columnCreate";
|
|
34
|
+
/** table property key when creating table*/
|
|
35
|
+
EntityContextType["TABLE_PROPERTY_KEY"] = "tablePropertyKey";
|
|
36
|
+
/** table property value when creating table*/
|
|
37
|
+
EntityContextType["TABLE_PROPERTY_VALUE"] = "tablePropertyValue";
|
|
34
38
|
})(EntityContextType || (EntityContextType = {}));
|
|
35
39
|
export var SqlSplitStrategy;
|
|
36
40
|
(function (SqlSplitStrategy) {
|
|
@@ -27,6 +27,8 @@ export class FlinkSQL extends BasicSQL {
|
|
|
27
27
|
FlinkSqlParser.RULE_columnName,
|
|
28
28
|
FlinkSqlParser.RULE_columnNamePath,
|
|
29
29
|
FlinkSqlParser.RULE_columnNameCreate,
|
|
30
|
+
FlinkSqlParser.RULE_tablePropertyKey,
|
|
31
|
+
FlinkSqlParser.RULE_tablePropertyValue,
|
|
30
32
|
]);
|
|
31
33
|
}
|
|
32
34
|
createLexerFromCharStream(charStreams) {
|
|
@@ -114,6 +116,14 @@ export class FlinkSQL extends BasicSQL {
|
|
|
114
116
|
}
|
|
115
117
|
break;
|
|
116
118
|
}
|
|
119
|
+
case FlinkSqlParser.RULE_tablePropertyKey: {
|
|
120
|
+
syntaxContextType = EntityContextType.TABLE_PROPERTY_KEY;
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
case FlinkSqlParser.RULE_tablePropertyValue: {
|
|
124
|
+
syntaxContextType = EntityContextType.TABLE_PROPERTY_VALUE;
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
117
127
|
default:
|
|
118
128
|
break;
|
|
119
129
|
}
|