apla / node-clickhouse

Yandex ClickHouse driver for nodejs
MIT License
216 stars 50 forks source link

Query SQL comment prefix query report error #72

Open KsssAlleria opened 3 years ago

KsssAlleria commented 3 years ago

For example SQL:
--admin SELECT date_time, app_id FROM basic.basic_day_all limit 2` execute SQL to return underfind,

Query source code is found to be a problem with this code:

if (chQuery.match (/^(?:SELECT|WITH|SHOW|DESC|DESCRIBE|EXISTS\s+TABLE)/i)) {
    if (!options.format)
        options.format = options.dataObjects ? 'JSON' : 'JSONCompact';
} else if (chQuery.match (/^INSERT/i)) {
      //
} 

I hope the author can help repair it, TK~

HelloKevinTian commented 3 years ago

Same issue, hope fixed quickly. @apla