Socket
Socket
Sign inDemoInstall

@clickhouse/client

Package Overview
Dependencies
Maintainers
4
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clickhouse/client - npm Package Versions

1345

1.0.0

Diff

Changelog

Source

1.0.0 (Common, Node.js, Web)

Formal stable release milestone with a lot of improvements and some breaking changes.

Major new features overview:

From now on, the client will follow the official semantic versioning guidelines.

Deprecated API

The following configuration parameters are marked as deprecated:

  • host configuration parameter is deprecated; use url instead.
  • additional_headers configuration parameter is deprecated; use http_headers instead.

The client will log a warning if any of these parameters are used. However, it is still allowed to use host instead of url and additional_headers instead of http_headers for now; this deprecation is not supposed to break the existing code.

These parameters will be removed in the next major release (2.0.0).

See "New features" section for more details.

serge.klochkov
published 0.3.1 •

Changelog

Source

0.3.1 (Common, Node.js, Web)

Bug fixes

  • Fixed an issue where query parameters containing tabs or newline characters were not encoded properly.
serge.klochkov
published 0.3.0 •

Changelog

Source

0.3.0 (Node.js only)

This release primarily focuses on improving the Keep-Alive mechanism's reliability on the client side.

New features

  • Idle sockets timeout rework; now, the client attaches internal timers to idling sockets, and forcefully removes them from the pool if it considers that a particular socket is idling for too long. The intention of this additional sockets housekeeping is to eliminate "Socket hang-up" errors that could previously still occur on certain configurations. Now, the client does not rely on KeepAlive agent when it comes to removing the idling sockets; in most cases, the server will not close the socket before the client does.

  • There is a new keep_alive.idle_socket_ttl configuration parameter. The default value is 2500 (milliseconds), which is considered to be safe, as ClickHouse versions prior to 23.11 had keep_alive_timeout set to 3 seconds by default, and keep_alive.idle_socket_ttl is supposed to be slightly less than that to allow the client to remove the sockets that are about to expire before the server does so.

  • Logging improvements: more internal logs on failing requests; all client methods except ping will log an error on failure now. A failed ping will log a warning, since the underlying error is returned as a part of its result. Client logging still needs to be enabled explicitly by specifying the desired log.level config option, as the log level is OFF by default. Currently, the client logs the following events, depending on the selected log.level value:

    • TRACE - low-level information about the Keep-Alive sockets lifecycle.
    • DEBUG - response information (without authorization headers and host info).
    • INFO - still mostly unused, will print the current log level when the client is initialized.
    • WARN - non-fatal errors; failed ping request is logged as a warning, as the underlying error is included in the returned result.
    • ERROR - fatal errors from query/insert/exec/command methods, such as a failed request.

Breaking changes

  • keep_alive.retry_on_expired_socket and keep_alive.socket_ttl configuration parameters are removed.
  • The max_open_connections configuration parameter is now 10 by default, as we should not rely on the KeepAlive agent's defaults.
  • Fixed the default request_timeout configuration value (now it is correctly set to 30_000, previously 300_000 (milliseconds)).

Bug fixes

  • Fixed a bug with Ping that could lead to an unhandled "Socket hang-up" propagation.
  • Ensure proper Connection header value considering Keep-Alive settings. If Keep-Alive is disabled, its value is now forced to "close".
serge.klochkov
published 0.3.0-beta.1 •

Changelog

Source

0.3.0-beta.1 (Node.js only)

See 0.3.0.

serge.klochkov
published 0.2.10 •

Changelog

Source

0.2.10 (Common, Node.js, Web)

New features

  • If InsertParams.values is an empty array, no request is sent to the server and ClickHouseClient.insert short-circuits itself. In this scenario, the newly added InsertResult.executed flag will be false, and InsertResult.query_id will be an empty string.

Bug fixes

  • Client no longer produces Code: 354. inflate failed: buffer error exception if request compression is enabled and InsertParams.values is an empty array (see above).
serge.klochkov
published 0.2.9 •

Changelog

Source

0.2.9 (Common, Node.js, Web)

New features

  • It is now possible to set additional HTTP headers for outgoing ClickHouse requests. This might be useful if, for example, you use a reverse proxy with authorization. (@teawithfruit, #224)
const client = createClient({
  additional_headers: {
    'X-ClickHouse-User': 'clickhouse_user',
    'X-ClickHouse-Key': 'clickhouse_password',
  },
})
serge.klochkov
published 0.2.8 •

Changelog

Source

0.2.8 (Common, Node.js, Web)

New features

  • (Web only) Allow to modify Keep-Alive setting (previously always disabled). Keep-Alive setting is now enabled by default for the Web version.
import { createClient } from '@clickhouse/client-web'
const client = createClient({ keep_alive: { enabled: true } })
  • (Node.js & Web) It is now possible to either specify a list of columns to insert the data into or a list of excluded columns:
// Generated query: INSERT INTO mytable (message) FORMAT JSONEachRow
await client.insert({
  table: 'mytable',
  format: 'JSONEachRow',
  values: [{ message: 'foo' }],
  columns: ['message'],
})

// Generated query: INSERT INTO mytable (* EXCEPT (message)) FORMAT JSONEachRow
await client.insert({
  table: 'mytable',
  format: 'JSONEachRow',
  values: [{ id: 42 }],
  columns: { except: ['message'] },
})

See also the new examples:

serge.klochkov
published 0.2.7 •

Changelog

Source

0.2.7 (Common, Node.js, Web)

New features

  • (Node.js only) X-ClickHouse-Summary response header is now parsed when working with insert/exec/command methods. See the related test for more details. NB: it is guaranteed to be correct only for non-streaming scenarios. Web version does not currently support this due to CORS limitations. (#210)

Bug fixes

  • Drain insert response stream in Web version - required to properly work with async_insert, especially in the Cloudflare Workers context.
serge.klochkov
published 0.2.6 •

Changelog

Source

0.2.6 (Common, Node.js)

New features

serge.klochkov
published 0.2.5 •

Changelog

Source

0.2.5 (Common, Node.js, Web)

Bug fixes

  • pathname segment from host client configuration parameter is now handled properly when making requests. See this comment for more details.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc