Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@clickhouse/client

Package Overview
Dependencies
Maintainers
4
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clickhouse/client - npm Package Versions

1235

0.2.0-beta1

Diff

serge.klochkov
published 0.1.1 •

Changelog

Source

0.1.1

New features

  • Expired socket detection on the client side when using Keep-Alive. If a potentially expired socket is detected, and retry is enabled in the configuration, both socket and request will be immediately destroyed (before sending the data), and the client will recreate the request. See ClickHouseClientConfigOptions.keep_alive for more details. Disabled by default.
  • Allow disabling Keep-Alive feature entirely.
  • TRACE log level.

Examples

Disable Keep-Alive feature
const client = createClient({
  keep_alive: {
    enabled: false,
  },
})
Retry on expired socket
const client = createClient({
  keep_alive: {
    enabled: true,
    // should be slightly less than the `keep_alive_timeout` setting in server's `config.xml`
    // default is 3s there, so 2500 milliseconds seems to be a safe client value in this scenario
    // another example: if your configuration has `keep_alive_timeout` set to 60s, you could put 59_000 here
    socket_ttl: 2500,
    retry_on_expired_socket: true,
  },
})
serge.klochkov
published 0.1.0 •

Changelog

Source

0.1.0

Breaking changes

  • connect_timeout client setting is removed, as it was unused in the code.

New features

  • command method is introduced as an alternative to exec. command does not expect user to consume the response stream, and it is destroyed immediately. Essentially, this is a shortcut to exec that destroys the stream under the hood. Consider using command instead of exec for DDLs and other custom commands which do not provide any valuable output.

Example:

// incorrect: stream is not consumed and not destroyed, request will be timed out eventually
await client.exec('CREATE TABLE foo (id String) ENGINE Memory')

// correct: stream does not contain any information and just destroyed
const { stream } = await client.exec(
  'CREATE TABLE foo (id String) ENGINE Memory',
)
stream.destroy()

// correct: same as exec + stream.destroy()
await client.command('CREATE TABLE foo (id String) ENGINE Memory')

Bug fixes

  • Fixed delays on subsequent requests after calling insert that happened due to unclosed stream instance when using low number of max_open_connections. See #161 for more details.
  • Request timeouts internal logic rework (see #168)
serge.klochkov
published 0.0.16 •

Changelog

Source

0.0.16

  • Fix NULL parameter binding. As HTTP interface expects \N instead of 'NULL' string, it is now correctly handled for both null and explicitly undefined parameters. See the test scenarios for more details.
serge.klochkov
published 0.0.15 •

Changelog

Source

0.0.15

Bug fixes

  • Fix Node.JS 19.x/20.x timeout error (@olexiyb)
serge.klochkov
published 0.0.14 •

Changelog

Source

0.0.14

New features

  • Added support for JSONStrings, JSONCompact, JSONCompactStrings, JSONColumnsWithMetadata formats (@andrewzolotukhin).
serge.klochkov
published 0.0.13 •

Changelog

Source

0.0.13

New features

  • query_id can be now overridden for all main client's methods: query, exec, insert.
serge.klochkov
published 0.0.12 •

Changelog

Source

0.0.12

New features

  • ResultSet.query_id contains a unique query identifier that might be useful for retrieving query metrics from system.query_log
  • User-Agent HTTP header is set according to the language client spec. For example, for client version 0.0.12 and Node.js runtime v19.0.4 on Linux platform, it will be clickhouse-js/0.0.12 (lv:nodejs/19.0.4; os:linux). If ClickHouseClientConfigOptions.application is set, it will be prepended to the generated User-Agent.

Breaking changes

  • client.insert now returns { query_id: string } instead of void
  • client.exec now returns { stream: Stream.Readable, query_id: string } instead of just Stream.Readable
serge.klochkov
published 0.0.11 •

Changelog

Source

0.0.11, 2022-12-08

Breaking changes

  • log.enabled flag was removed from the client configuration.
  • Use CLICKHOUSE_LOG_LEVEL environment variable instead. Possible values: OFF, TRACE, DEBUG, INFO, WARN, ERROR. Currently, there are only debug messages, but we will log more in the future.

For more details, see PR #110

serge.klochkov
published 0.0.10 •

Changelog

Source

0.0.10, 2022-11-14

New features

  • Remove request listeners synchronously. #123
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