lua_clickhouse
This module contains Clickhouse access functions
Functions:
Function | Description |
---|---|
lua_clickhouse.select(upstream, settings, params, query, |
ok_cb, fail_cb). |
lua_clickhouse.select_sync(upstream, settings, params, query, |
ok_cb, fail_cb, row_cb). |
lua_clickhouse.insert(upstream, settings, params, query, rows, |
ok_cb, fail_cb). |
lua_clickhouse.generic(upstream, settings, params, query, |
ok_cb, fail_cb). |
lua_clickhouse.generic_sync(upstream, settings, params, query, |
ok_cb, fail_cb). |
The module lua_clickhouse
defines the following functions.
lua_clickhouse.select(upstream, settings, params, query,
ok_cb, fail_cb) Make select request to clickhouse * use_gsip: use gzip compression * timeout: request timeout * no_ssl_verify: skip SSL verification * user: HTTP user * password: HTTP password
Parameters:
upstream {upstream}
: clickhouse server upstreamsettings {table}
: global settings table:HTTP {params}
: request paramsquery {string}
: select query (passed in HTTP body)ok_cb {function}
: callback to be called in case of successfail_cb {function}
: callback to be called in case of some errorrow_cb {function}
: optional callback to be called on each parsed data row (instead of table insertion)Returns:
{boolean}
: whether a connection was successfulBack to module description.
lua_clickhouse.select_sync(upstream, settings, params, query,
ok_cb, fail_cb, row_cb) Make select request to clickhouse * use_gsip: use gzip compression * timeout: request timeout * no_ssl_verify: skip SSL verification * user: HTTP user * password: HTTP password
{string} error message if exists
nil | {rows} | {http_response}
Parameters:
upstream {upstream}
: clickhouse server upstreamsettings {table}
: global settings table:HTTP {params}
: request paramsquery {string}
: select query (passed in HTTP body)ok_cb {function}
: callback to be called in case of successfail_cb {function}
: callback to be called in case of some errorrow_cb {function}
: optional callback to be called on each parsed data row (instead of table insertion)Returns:
Back to module description.
lua_clickhouse.insert(upstream, settings, params, query, rows,
ok_cb, fail_cb) Insert data rows to clickhouse * use_gsip: use gzip compression * timeout: request timeout * no_ssl_verify: skip SSL verification * user: HTTP user * password: HTTP password
Parameters:
upstream {upstream}
: clickhouse server upstreamsettings {table}
: global settings table:HTTP {params}
: request paramsquery {string}
: select query (passed in query
request element with spaces escaped)rows {table|mixed}
: mix of strings, numbers or tables (for arrays)ok_cb {function}
: callback to be called in case of successfail_cb {function}
: callback to be called in case of some errorReturns:
{boolean}
: whether a connection was successfulBack to module description.
lua_clickhouse.generic(upstream, settings, params, query,
ok_cb, fail_cb) Make a generic request to Clickhouse (e.g. alter) * use_gsip: use gzip compression * timeout: request timeout * no_ssl_verify: skip SSL verification * user: HTTP user * password: HTTP password
Parameters:
upstream {upstream}
: clickhouse server upstreamsettings {table}
: global settings table:HTTP {params}
: request paramsquery {string}
: Clickhouse query (passed in query
request element with spaces escaped)ok_cb {function}
: callback to be called in case of successfail_cb {function}
: callback to be called in case of some errorReturns:
{boolean}
: whether a connection was successfulBack to module description.
lua_clickhouse.generic_sync(upstream, settings, params, query,
ok_cb, fail_cb) Make a generic request to Clickhouse (e.g. alter) * use_gsip: use gzip compression * timeout: request timeout * no_ssl_verify: skip SSL verification * user: HTTP user * password: HTTP password
Parameters:
upstream {upstream}
: clickhouse server upstreamsettings {table}
: global settings table:HTTP {params}
: request paramsquery {string}
: Clickhouse query (passed in query
request element with spaces escaped)Returns:
{boolean}
: whether a connection was successfulBack to module description.
Back to top.