Skip to content

0.2.0 - Web platform support

Compare
Choose a tag to compare
@slvrtrn slvrtrn released this 26 Jul 16:31
· 76 commits to main since this release

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.