From 1b14fdfa5745d727a2d5f8de8484e806ad580d67 Mon Sep 17 00:00:00 2001 From: Vadim Baryshev Date: Sat, 1 Jul 2017 10:34:20 +0300 Subject: [PATCH] Support for ALTER query --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index caf078d..97d3251 100644 --- a/index.js +++ b/index.js @@ -149,7 +149,7 @@ class ClickHouse { // 'INSERT INTO t VALUES (1),(2),(3)' || 'SELECT date, count() FROM log WHERE siteId = '123' else if (opts.query && ! opts.body) { - if ( ! opts.query.match(/^insert/i) && (!opts.query.match(/^create/i)) && !opts.query.match(/^drop/i)) { + if (!opts.query.match(/^(insert|create|drop|alter)/i)) { opts.query += ' FORMAT TabSeparatedWithNamesAndTypes'; }