Shuts down the underlying connection. This method should ideally be called only once per application lifecycle, for example, during the graceful shutdown phase.
It should be used for statements that do not have any output, when the format clause is not applicable, or when you are not interested in the response at all. The response stream is destroyed immediately as we do not expect useful information there. Examples of such statements are DDLs or custom inserts.
if you have a custom query that does not work with ClickHouseClient.query, and you are interested in the response data, consider using ClickHouseClient.exec.
Similar to ClickHouseClient.command, but for the cases where the output is expected, but format clause is not applicable. The caller of this method must consume the stream, as the underlying socket will not be released until then, and the request will eventually be timed out.
it is not intended to use this method to execute the DDLs, such as CREATE TABLE or similar;
use ClickHouseClient.command instead.
The primary method for data insertion. It is recommended to avoid arrays in case of large inserts to reduce application memory consumption and consider streaming for most of such use cases. As the insert operation does not provide any output, the response stream is immediately destroyed.
in case of a custom insert operation (e.g., INSERT FROM SELECT),
consider using ClickHouseClient.command, passing the entire raw query there
(including the FORMAT clause).
A health-check request. It does not throw if an error occurs - the error is returned inside the result object.
By default, Node.js version uses the built-in /ping endpoint, which does not verify credentials.
Optionally, it can be switched to a SELECT query (see PingParamsWithSelectQuery).
In that case, the server will verify the credentials.
NOTE: Since the /ping endpoint does not support CORS, the Web version always uses a SELECT query.
Optionalparams: PingParams
Closes the client connection.
Automatically called when using
usingstatement in supported environments.