Skip to content

Releases: ClickHouse/clickhouse-js

0.2.8 (Common, Node.js, Web)

12 Jan 11:05
aafc649
Compare
Choose a tag to compare

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:

0.2.7 (Common, Node.js, Web)

13 Dec 17:39
152b89a
Compare
Choose a tag to compare

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.
    The 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.

0.2.6 (Common/Node.js)

16 Nov 23:03
ddfd077
Compare
Choose a tag to compare

New features

0.2.5 (Common, Node.js & Web)

30 Oct 19:43
c836bb1
Compare
Choose a tag to compare

Bug fixes

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

0.2.4 (Node.js only)

17 Oct 14:33
2552dbb
Compare
Choose a tag to compare

No changes in web/common modules.

Bug fixes

  • (Node.js only) Fixed an issue where streaming large datasets could provide corrupted results. See #171 (issue) and #204 (PR) for more details.

0.2.3 (Node.js only)

11 Oct 15:56
Compare
Choose a tag to compare

No changes in web/common modules.

Bug fixes

  • (Node.js only) Fixed an issue where the underlying socket was closed every time after using insert with a keep_alive option enabled, which led to performance limitations. See #202 for more details. (@varrocs)

0.2.2 (Common, Node.js & Web)

02 Sep 15:12
50f790f
Compare
Choose a tag to compare

New features

  • Added missing default_format setting, which allows to perform exec calls without the FORMAT clause. See the example.

0.2.1 (Common, Node.js & Web)

10 Aug 19:20
Compare
Choose a tag to compare

Breaking changes

Date objects in query parameters are now serialized as time-zone-agnostic Unix timestamps (NNNNNNNNNN[.NNN], optionally with millisecond-precision) instead of datetime strings without time zones (YYYY-MM-DD HH:MM:SS[.MMM]). This means the server will receive the same absolute timestamp the client sent even if the client's time zone and the database server's time zone differ. Previously, if the server used one time zone and the client used another, Date objects would be encoded in the client's time zone and decoded in the server's time zone and create a mismatch.

For instance, if the server used UTC (GMT) and the client used PST (GMT-8), a Date object for "2023-01-01 13:00:00 PST" would be encoded as "2023-01-01 13:00:00.000" and decoded as "2023-01-01 13:00:00 UTC" (which is 2023-01-01 05:00:00 PST). Now, "2023-01-01 13:00:00 PST" is encoded as "1672606800000" and decoded as "2023-01-01 21:00:00 UTC", the same time the client sent.

Props to @ide for implementing it.

0.2.0 - Web platform support

26 Jul 16:31
Compare
Choose a tag to compare

Introduces web client (using native fetch and WebStream APIs) without Node.js modules in the common interfaces.
No polyfills are required.

The web client is confirmed to work with Chrome/Firefox/CloudFlare workers.

It is now possible to implement new custom connections on top of @clickhouse/client-common.

The repository was refactored into three packages:

  • @clickhouse/client-common: all possible platform-independent code, types and interfaces
  • @clickhouse/client-web: new web (or non-Node.js env) connection, uses native fetch.
  • @clickhouse/client: Node.js connection as it was before.

Node.js client breaking changes

  • Changed ping method behavior: it will not throw now.
    Instead, either { success: true } or { success: false, error: Error } is returned.
  • Log level configuration parameter is now explicit instead of CLICKHOUSE_LOG_LEVEL environment variable.
    Default is OFF.
  • query return type signature changed to is BaseResultSet<Stream.Readable> (no functional changes)
  • exec return type signature changed to ExecResult<Stream.Readable> (no functional changes)
  • insert<T> params argument type changed to InsertParams<Stream, T> (no functional changes)
  • Experimental schema module is removed

Web client known limitations

  • Streaming for select queries works, but it is disabled for inserts (on the type level as well).
  • KeepAlive is disabled and not configurable yet.
  • Request compression is disabled and configuration is ignored. Response compression works.
  • No logging support yet.

0.2.0-beta1 (browser support)

19 Jul 20:37
Compare
Choose a tag to compare
Pre-release

Introduces browser client (using native fetch and WebStream APIs) with no Node.js modules in the common interfaces.
No polyfills are required.

It is now possible to implement new custom connections on top of @clickhouse/client-common.

The client was refactored into three packages:

  • @clickhouse/client-common: all possible platform-independent code, types and interfaces
  • @clickhouse/client-browser: new "browser" (or non-Node.js env) connection, uses native fetch.
  • @clickhouse/client: Node.js connection as it was before.

Node.js client breaking changes

  • Log level configuration parameter is now explicit instead of CLICKHOUSE_LOG_LEVEL environment variable.
    Default is OFF.
  • query return type signature changed to is BaseResultSet<Stream.Readable> (no functional changes)
  • exec return type signature changed to ExecResult<Stream.Readable> (no functional changes)
  • insert<T> params argument type changed to InsertParams<Stream, T> (no functional changes)
  • Experimental schema module is removed

Browser client known limitations

  • Streaming for select queries works, but it is disabled for inserts (on the type level as well).
  • KeepAlive is disabled and not configurable yet.
  • Request compression is disabled and ignored.
  • No logging support yet.