unstale

npm / @clickhouse/client

@clickhouse/client

What changed in @clickhouse/client 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

16 breaking1 security7 deprecations23 new APIs and options2 performance13 behavior and defaults11 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

@clickhouse/client 173 changes

Breaking changes 16

  • For errors returned in JSON output formats, ClickHouseError.message no longer retains JSON escaping.

    1.25.0release notes

  • exec() sends the query as written without removing trailing semicolons, except when used with values, where trailing semicolons are still removed.

    1.25.0release notes

  • query() sends SQL as written and passes format as the server's default_format setting instead of appending a FORMAT clause. The format option overrides clickhouse_settings.default_format; query() does not send X-ClickHouse-Format headers.

    1.25.0release notes

  • A standalone, dependency-free package parses ClickHouse data-type strings and emits a JSON AST that mirrors the server's data-type AST.

    1.23.0release notes

  • The Node.js engine floor for @clickhouse/client and @clickhouse/datatype-parser is now >=20; Node.js 18.x is no longer supported.

    1.23.0release notes

  • The web client rejects the zstd codec when the client is created.

    1.22.0release notes

  • compress_request and decompress_response change from booleans to normalized codec objects or undefined, affecting direct users of the deprecated low-level package.

    1.22.0release notes

  • The low-level function takes request and response codec values instead of boolean enable flags; the codec determines the emitted Content-Encoding and Accept-Encoding.

    1.22.0release notes

  • The low-level function takes a response codec object or undefined instead of a boolean.

    1.22.0release notes

  • Tracing follows OpenTelemetry database semantic conventions, updates span attributes and status behavior, and records response-side attributes and insert row counts.

    1.21.0release notes

  • The client now rejects responses with this header as parsed ClickHouseError instances, even when the HTTP status indicates success.

    1.21.0release notes

  • Now unescapes backslash sequences in enum names, returning decoded values such as a single quote instead of preserving the raw escape sequence.

    1.19.0release notes

  • Node.js and Web versions now uniformly export ClickHouseClient and ClickHouseClientConfigOptions types specific to each implementation; ClickHouseClient no longer exposes a Stream type parameter.

    1.0.0release notes

  • Response compression is disabled by default; explicitly enable it in client configuration to continue using it.

    1.0.0release notes

  • Adds http_headers as a direct replacement for additional_headers; its function is unchanged.

    1.0.0release notes

  • When using URL configuration, specify pathname as a separate configuration option because the URL path is otherwise considered the database.

    1.0.0release notes

Security 1

  • On Node.js, hardened stream consumption through a single consume() path that marks the result set as consumed in the appropriate branches, after format validation.

    1.20.0release notes

Deprecations 7

  • The package is deprecated and will no longer receive updates; import its former exports from @clickhouse/client or @clickhouse/client-web instead.

    1.23.0release notes

  • This function is deprecated and slated for removal in a future major version; use @clickhouse/datatype-parser's parseDataType instead.

    1.23.0release notes

  • This companion is deprecated and slated for removal in a future major version; use @clickhouse/datatype-parser's parseDataType instead.

    1.23.0release notes

  • The utility is deprecated because the client drains streams internally when needed; use client.command() instead.

    1.18.1release notes

  • The utility is deprecated because it is not intended for use outside the client implementation; use setTimeout directly or a utility library for additional features.

    1.18.1release notes

  • The additional_headers configuration parameter is deprecated in favor of http_headers. Using it logs a warning, but remains allowed for now.

    1.0.0release notes

  • The host configuration parameter is deprecated in favor of url. Using it logs a warning, but remains allowed for now.

    1.0.0release notes

New APIs and options 23

  • This type is now exported from the package root and can be imported from @clickhouse/client.

    1.24.0release notes

  • This client option defaults to false; when enabled, raw SQL is attached to spans and included in error-level logs for failed requests. Bound query_params values and credentials are never logged or traced.

    1.24.0release notes

  • A per-request query parameter field lets callers add application-level context to operation spans; caller attributes cannot override the client's db.*, server.*, or clickhouse.* attributes.

    1.24.0release notes

  • A package-neutral structural settings type is exported by the Node.js and Web clients, allowing shared settings helpers to type-check across both clients without casts.

    1.23.0release notes

  • An experimental additive option lets callers provide an externally built backend Connection-like object instead of using the default HTTP(S) factory; it is intended only for testing the chDB integration.

    1.23.0release notes

  • The Node.js client accepts an object specifying zstd compression; true continues to select gzip. zstd requires Node.js >= 22.15.0.

    1.22.0release notes

  • The Node.js client adds Brotli request compression using { codec: "br" }; its optional quality tunes compression and defaults to 4 for request bodies.

    1.22.0release notes

  • A new exported type represents compression methods for direct users of the deprecated low-level package.

    1.22.0release notes

  • A new exported type represents request compression settings for direct users of the deprecated low-level package.

    1.22.0release notes

  • A new exported type represents response compression settings for direct users of the deprecated low-level package.

    1.22.0release notes

  • query() emits a child stream span that tracks ResultSet consumption separately from the HTTP request span, ending when the response is read, closed, or fails.

    1.21.0release notes

  • Sends query_params as multipart/form-data body parts instead of URL query-string entries, with SQL moved into a query part.

    1.21.0release notes

  • Automatically sends query_params as multipart/form-data when their URL-encoded length exceeds 4096 characters; smaller payloads remain in the URL.

    1.21.0release notes

  • Re-exported the type from @clickhouse/client and @clickhouse/client-web, so consumers can depend on either flavored package without importing @clickhouse/client-common.

    1.19.0release notes

  • The package ships Node-client-specific AI-agent coding and troubleshooting skills under node_modules/@clickhouse/client/skills/ and declares them for discovery tools.

    1.18.5release notes

  • Node.js clients can set max_response_headers_size to raise the per-request limit on response header size, avoiding HPE_HEADER_OVERFLOW for large accumulated progress headers.

    1.18.5release notes

  • Adds a Node.js-only option, defaulting to false, that destroys sockets idle longer than idle_socket_ttl immediately before each request.

    1.18.3release notes

  • Added http_status_code to query, insert, and exec commands.

    1.17.0release notes

  • Supports the Disposable API (using), which automatically closes the client even if code throws, avoiding a try/finally cleanup block.

    1.16.0release notes

  • BigInt values are now supported in query parameters.

    1.15.0release notes

  • Node.js callers can use the new parameter to manually handle request errors on the application side.

    1.14.0release notes

  • Custom parse and stringify functions can replace JSON.parse and JSON.stringify when working with JSON* family formats.

    1.14.0release notes

  • Adds URL configuration for most client parameters, including credentials, database, settings, and HTTP headers. URL values always overwrite hardcoded values and log a warning.

    1.0.0release notes

Performance 2

  • Log messages are constructed only when the configured log level is appropriate, which can improve performance when constructing ignored messages is expensive.

    1.18.1release notes

  • On Node.js, decoding entire row sets with streamable JSON formats is improved by using the same stream transformer as ResultSet.stream; streaming performance is unchanged.

    1.0.0release notes

Behavior and default changes 13

  • command() sends the query as written without removing trailing semicolons, which the server accepts.

    1.25.0release notes

  • The X-ClickHouse-Summary counters are now attached to the clickhouse.query span, making request-level metrics visible on the outer client span.

    1.24.0release notes

  • Every key in the summary header is recorded as a span attribute, including memory_usage and future server-side additions.

    1.24.0release notes

  • This span attribute is now recorded for non-streaming result consumption, including json() on single-document JSON formats.

    1.24.0release notes

  • The Node.js client accepts zstd response compression; decompression follows the server's actual Content-Encoding. zstd requires Node.js >= 22.15.0.

    1.22.0release notes

  • The Node.js client supports Brotli response decompression, following the server's Content-Encoding.

    1.22.0release notes

  • The client now warns when request_timeout exceeds 60 seconds and progress headers are not configured, helping users avoid socket hang-up errors on long-running queries.

    1.18.3release notes

  • When keep_alive is enabled, an ECONNRESET from the server now emits a WARN log suggesting that idle_socket_ttl be checked and including the server keep-alive timeout when available.

    1.18.2release notes

  • The client now passes rich context, including connection_id, query_id, request_id, and socket_id, to the logger's args parameter.

    1.18.1release notes

  • TRACE logging includes additional lifecycle messages and connection, request, and socket identifiers to help trace requests across a connection lifecycle.

    1.18.1release notes

  • The default log level is now ClickHouseLogLevel.WARN instead of ClickHouseLogLevel.OFF, providing visibility into potential issues by default.

    1.18.1release notes

  • The constructor now accepts a readonly array, permitting more usages.

    1.13.0release notes

  • TypeScript types for query results are inferred from the query format, including result shapes and which json or stream methods are allowed. Row types are also inferred for streams.

    1.0.0release notes

Fixes and other changes 11

  • In Node.js, ResultSet.close() no longer throws an uncaught error when the ResultSet wraps a stream without an error listener.

    1.25.0release notes

  • On Node.js, prevents an orphaned idle-socket timer from destroying a socket during a request that took it over after another queued request was aborted.

    1.24.1release notes

  • Date values nested in arrays, tuples, and maps are now emitted as quoted UTC date strings; nested Array(DateTime) and Array(DateTime64) bindings use day precision, while scalar binding is unchanged.

    1.24.0release notes

  • This type is now exported from the package root and can be imported from @clickhouse/client.

    1.24.0release notes

  • This type is now exported from the package root and can be imported from @clickhouse/client.

    1.24.0release notes

  • Re-exported from @clickhouse/client after being missed when the client-common public API was bundled into the client packages.

    1.23.1release notes

  • The Web ResultSet.stream() path now ends its stream span when the fetch stream aborts or the consumer cancels.

    1.21.0release notes

  • On Node.js, fixed a race on streamable result sets that could make json() throw “Stream has been already consumed” when the stream ended during internal checks.

    1.20.0release notes

  • Fixed ignore_error_response not being passed when using command.

    1.17.0release notes

  • Boolean values inside Array, Tuple, and Map query parameter types are formatted as TRUE/FALSE instead of 1/0 for ClickHouse type compatibility.

    1.13.0release notes

  • Exceptions occurring in the middle of the HTTP stream are now handled correctly. This requires ClickHouse 25.11 or later; previous ClickHouse versions are unaffected.

    1.13.0release notes