version 2.0.0

This commit is contained in:
HSunboy 2019-09-25 15:47:08 +08:00
parent 8d7040d04b
commit d8bb77810b
3 changed files with 5 additions and 1 deletions

View File

@ -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);

View File

@ -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]') {

View File

@ -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",