Socket
Socket
Sign inDemoInstall

@clickhouse/client-common

Package Overview
Dependencies
Maintainers
4
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clickhouse/client-common - npm Package Versions

23

1.6.0

Diff

Changelog

Source

1.6.0 (Common, Node.js, Web)

New features

  • Added optional real_time_microseconds field to the ClickHouseSummary interface (see https://github.com/ClickHouse/ClickHouse/pull/69032)

Bug fixes

  • Fixed unhandled exceptions produced when calling ResultSet.json if the response data was not in fact a valid JSON. (#311)
serge.klochkov
published 1.5.0 •

Changelog

Source

1.5.0 (Node.js)

New features

  • It is now possible to disable the automatic decompression of the response stream with the exec method. See ExecParams.decompress_response_stream for more details. (#298).
serge.klochkov
published 1.4.1 •

Changelog

Source

1.4.1 (Node.js, Web)

Improvements

  • ClickHouseClient is now exported as a value from @clickhouse/client and @clickhouse/client-web packages, allowing for better integration in dependency injection frameworks that rely on IoC (e.g., Nest.js, tsyringe) (@mathieu-bour, #292).

Bug fixes

  • Fixed a potential socket hang up issue that could happen under 100% CPU load (#294).
serge.klochkov
published 1.4.0 •

Changelog

Source

1.4.0 (Node.js)

New features

  • (Node.js only) The exec method now accepts an optional values parameter, which allows you to pass the request body as a Stream.Readable. This can be useful in case of custom insert streaming with arbitrary ClickHouse data formats (which might not be explicitly supported and allowed by the client in the insert method yet). NB: in this case, you are expected to serialize the data in the stream in the required input format yourself.
serge.klochkov
published 1.3.0 •

Changelog

Source

1.3.0 (Common, Node.js, Web)

New features

  • It is now possible to get the entire response headers object from the query/insert/command/exec methods. With query, you can access the ResultSet.response_headers property; other methods (insert/command/exec) return it as parts of their response objects as well. For example:

    const rs = await client.query({
      query: 'SELECT * FROM system.numbers LIMIT 1',
      format: 'JSONEachRow',
    })
    console.log(rs.response_headers['content-type'])
    

    This will print: application/x-ndjson; charset=UTF-8. It can be used in a similar way with the other methods.

Improvements

  • Re-exported several constants from the @clickhouse/client-common package for convenience:

    • SupportedJSONFormats
    • SupportedRawFormats
    • StreamableFormats
    • StreamableJSONFormats
    • SingleDocumentJSONFormats
    • RecordsJSONFormats
serge.klochkov
published 1.2.0 •

Changelog

Source

1.2.0 (Node.js)

New features

  • (Experimental) Added an option to provide a custom HTTP Agent in the client configuration via the http_agent option (#283, related: #278). The following conditions apply if a custom HTTP Agent is provided:

    • The max_open_connections and tls options will have no effect and will be ignored by the client, as it is a part of the underlying HTTP Agent configuration.
    • keep_alive.enabled will only regulate the default value of the Connection header (true -> Connection: keep-alive, false -> Connection: close).
    • While the idle socket management will still work, it is now possible to disable it completely by setting the keep_alive.idle_socket_ttl value to 0.
  • (Experimental) Added a new client configuration option: set_basic_auth_header, which disables the Authorization header that is set by the client by default for every outgoing HTTP request. One of the possible scenarios when it is necessary to disable this header is when a custom HTTPS agent is used, and the server requires TLS authorization. For example:

    const agent = new https.Agent({
      ca: fs.readFileSync('./ca.crt'),
    })
    const client = createClient({
      url: 'https://server.clickhouseconnect.test:8443',
      http_agent: agent,
      // With a custom HTTPS agent, the client won't use the default HTTPS connection implementation; the headers should be provided manually
      http_headers: {
        'X-ClickHouse-User': 'default',
        'X-ClickHouse-Key': '',
      },
      // Authorization header conflicts with the TLS headers; disable it.
      set_basic_auth_header: false,
    })
    

NB: It is currently not possible to set the set_basic_auth_header option via the URL params.

If you have feedback on these experimental features, please let us know by creating an issue in the repository.

serge.klochkov
published 1.1.0 •

Changelog

Source

1.1.0 (Common, Node.js, Web)

New features

  • Added an option to override the credentials for a particular query/command/exec/insert request via the BaseQueryParams.auth setting; when set, the credentials will be taken from there instead of the username/password provided during the client instantiation (#278).
  • Added an option to override the session_id for a particular query/command/exec/insert request via the BaseQueryParams.session_id setting; when set, it will be used instead of the session id provided during the client instantiation (@holi0317, #271).

Bug fixes

  • Fixed the incorrect ResponseJSON<T>.totals TypeScript type. Now it correctly matches the shape of the data (T, default = unknown) instead of the former Record<string, number> definition (#274).
serge.klochkov
published 1.0.2 •

Changelog

Source

1.0.2 (Common, Node.js, Web)

Bug fixes

  • The command method now drains the response stream properly, as the previous implementation could cause the Keep-Alive socket to close after each request.
  • Removed an unnecessary error log in the ResultSet.stream method if the request was aborted or the result set was closed (#263).

Improvements

  • ResultSet.stream logs an error via the Logger instance, if the stream emits an error event instead of a simple console.error call.
  • Minor adjustments to the DefaultLogger log messages formatting.
  • Added missing rows_before_limit_at_least to the ResponseJSON type (@0237h, #267).
serge.klochkov
published 1.0.1 •

Changelog

Source

1.0.1 (Common, Node.js, Web)

Bug fixes

  • Fixed the regression where the default HTTP/HTTPS port numbers (80/443) could not be used with the URL configuration (#258).
serge.klochkov
published 1.0.0 •

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.

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