aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_clickhouse.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lualib/lua_clickhouse.lua')
-rw-r--r--lualib/lua_clickhouse.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/lualib/lua_clickhouse.lua b/lualib/lua_clickhouse.lua
index dbb74e283..96ea59f02 100644
--- a/lualib/lua_clickhouse.lua
+++ b/lualib/lua_clickhouse.lua
@@ -227,7 +227,7 @@ exports.select = function (upstream, settings, params, query, ok_cb, fail_cb)
connect_prefix = 'https://'
end
local ip_addr = upstream:get_addr():to_string(true)
- local database = params.database or 'default'
+ local database = settings.database or 'default'
http_params.url = string.format('%s%s/?database=%s&default_format=JSONEachRow',
connect_prefix, ip_addr, escape_spaces(database))
end
@@ -278,7 +278,7 @@ exports.select_sync = function (upstream, settings, params, query, ok_cb, fail_c
connect_prefix = 'https://'
end
local ip_addr = upstream:get_addr():to_string(true)
- local database = params.database or 'default'
+ local database = settings.database or 'default'
http_params.url = string.format('%s%s/?database=%s&default_format=JSONEachRow',
connect_prefix, ip_addr, escape_spaces(database))
end
@@ -342,7 +342,7 @@ exports.insert = function (upstream, settings, params, query, rows,
connect_prefix = 'https://'
end
local ip_addr = upstream:get_addr():to_string(true)
- local database = params.database or 'default'
+ local database = settings.database or 'default'
http_params.url = string.format('%s%s/?database=%s&query=%s%%20FORMAT%%20TabSeparated',
connect_prefix,
ip_addr,
@@ -394,7 +394,7 @@ exports.generic = function (upstream, settings, params, query,
connect_prefix = 'https://'
end
local ip_addr = upstream:get_addr():to_string(true)
- local database = params.database or 'default'
+ local database = settings.database or 'default'
http_params.url = string.format('%s%s/?database=%s&default_format=JSONEachRow',
connect_prefix, ip_addr, escape_spaces(database))
end
@@ -439,7 +439,7 @@ exports.generic_sync = function (upstream, settings, params, query)
connect_prefix = 'https://'
end
local ip_addr = upstream:get_addr():to_string(true)
- local database = params.database or 'default'
+ local database = settings.database or 'default'
http_params.url = string.format('%s%s/?database=%s&default_format=JSONEachRow',
connect_prefix, ip_addr, escape_spaces(database))
end