From d789e06e413bf6b3f636fce011b20746855bcb79 Mon Sep 17 00:00:00 2001 From: HSunboy Date: Tue, 28 Aug 2018 11:35:00 +0800 Subject: [PATCH] add params --- lib/parser.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/parser.js b/lib/parser.js index 7779906..3e72da9 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -29,14 +29,26 @@ function parseSyntax(sql, type) { if (typeof type == "undefined") { type = "hive" } - return sqlSyntaxParser.parser.parseSyntax(sql, '', type, false) + let sql1=sql; + let sql2=''; + if(sql instanceof Array){ + sql1=sql[0]; + sql2=sql[1]; + } + return sqlSyntaxParser.parser.parseSyntax(sql1, sql2, type, false) } function parserSql(sql, type) { if (typeof type == "undefined") { type = "hive" } - return sqlAutoCompleteParser.parser.parseSql(sql, '', type, false) + let sql1=sql; + let sql2=''; + if(sql instanceof Array){ + sql1=sql[0]; + sql2=sql[1]; + } + return sqlAutoCompleteParser.parser.parseSql(sql1, sql2, type, false) } exports.parse = parse;