version 2.0.0
This commit is contained in:
parent
8d7040d04b
commit
d8bb77810b
@ -20,6 +20,9 @@ class SqlErrorListener extends error_1.ErrorListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function parserSingle(sql) {
|
function parserSingle(sql) {
|
||||||
|
if (!sql || !sql.trim()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
const inputStream = new antlr4.InputStream(sql.toUpperCase());
|
const inputStream = new antlr4.InputStream(sql.toUpperCase());
|
||||||
const lexer = new sqlLexer_1.sqlLexer(inputStream);
|
const lexer = new sqlLexer_1.sqlLexer(inputStream);
|
||||||
const tokenStream = new antlr4.CommonTokenStream(lexer);
|
const tokenStream = new antlr4.CommonTokenStream(lexer);
|
||||||
|
@ -9,6 +9,7 @@ var sqlType;
|
|||||||
sqlType["None"] = "sql";
|
sqlType["None"] = "sql";
|
||||||
sqlType["Impala"] = "impala";
|
sqlType["Impala"] = "impala";
|
||||||
})(sqlType || (sqlType = {}));
|
})(sqlType || (sqlType = {}));
|
||||||
|
exports.sqlType = sqlType;
|
||||||
function sqlToParserArgs(sql) {
|
function sqlToParserArgs(sql) {
|
||||||
let preSql = '', sufSql = '';
|
let preSql = '', sufSql = '';
|
||||||
if (Object.prototype.toString.call(sql) == '[object Array]') {
|
if (Object.prototype.toString.call(sql) == '[object Array]') {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "dt-sql-parser",
|
"name": "dt-sql-parser",
|
||||||
"version": "1.2.1",
|
"version": "2.0.0",
|
||||||
"description": "sql,hive,parser ",
|
"description": "sql,hive,parser ",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"hive",
|
"hive",
|
||||||
|
Loading…
Reference in New Issue
Block a user