This commit is contained in:
HSunboy 2019-06-04 17:54:27 +08:00
parent 711721ec0e
commit e79a5a3d07
4 changed files with 7 additions and 2 deletions

View File

@ -15,6 +15,9 @@ function sqlToParserArgs(sql) {
preSql = sql[0]; preSql = sql[0];
sufSql = sql[1]; sufSql = sql[1];
} }
else {
preSql = sql;
}
return [preSql, sufSql]; return [preSql, sufSql];
} }
/** /**

View File

@ -1,6 +1,6 @@
{ {
"name": "dt-sql-parser", "name": "dt-sql-parser",
"version": "1.2.0", "version": "1.2.1",
"description": "sql,hive,parser ", "description": "sql,hive,parser ",
"keywords": [ "keywords": [
"hive", "hive",
@ -13,7 +13,7 @@
"build:parse": "pegjs -o core/astParser.js peg/nquery.pegjs ", "build:parse": "pegjs -o core/astParser.js peg/nquery.pegjs ",
"build:filter": "pegjs -o core/comment.js peg/comment.pegjs ", "build:filter": "pegjs -o core/comment.js peg/comment.pegjs ",
"build:syntax": "sh ./jison/hue-sql-syntax.sh ", "build:syntax": "sh ./jison/hue-sql-syntax.sh ",
"build": "jest && rm -rf lib && tsc", "build": "rm -rf lib && tsc && jest",
"test": "jest" "test": "jest"
}, },
"author": "xiaokang", "author": "xiaokang",

View File

@ -13,6 +13,8 @@ function sqlToParserArgs (sql: sql) {
if(Object.prototype.toString.call(sql) == '[object Array]'){ if(Object.prototype.toString.call(sql) == '[object Array]'){
preSql=sql[0]; preSql=sql[0];
sufSql=sql[1]; sufSql=sql[1];
} else {
preSql = sql as string;
} }
return [preSql, sufSql]; return [preSql, sufSql];
} }

0
test/t.js Normal file
View File