Skip to content

Releases: ClickHouse/clickhouse-js

1.9.1 (Node.js only)

10 Dec 16:19
Compare
Choose a tag to compare
  • Fixed an uncaught exception that could happen in case of malformed ClickHouse response when response compression is enabled (#363)

1.9.0 (Common, Node.js, Web)

29 Nov 18:44
Compare
Choose a tag to compare

New features

  • Added input_format_json_throw_on_bad_escape_sequence to the ClickhouseSettings type. (#355, @emmanuel-bonin)
  • The client now exports TupleParam wrapper class, allowing tuples to be properly used as query parameters. Added support for JS Map as a query parameter. (#359)

Improvements

  • The client will throw a more informative error if the buffered response is larger than the max allowed string length in V8, which is 2**29 - 24 bytes. (#357)

1.8.1 (Node.js only)

14 Nov 22:15
8b41e5b
Compare
Choose a tag to compare

Bug fixes

  • When a custom HTTP agent is used, the HTTP or HTTPS request implementation is now correctly chosen based on the URL protocol. (#352)

1.8.0 (Common, Node.js, Web)

07 Nov 18:32
Compare
Choose a tag to compare

New features

1.7.0

18 Oct 14:31
a12e43f
Compare
Choose a tag to compare

Bug fixes

  • (Web only) Fixed an issue where streaming large datasets could provide corrupted results. See #333 (PR) for more details.

New features

  • Added JSONEachRowWithProgress format support, ProgressRow interface, and isProgressRow type guard. See this Node.js example for more details. It should work similarly with the Web version.

  • (Experimental) Exposed the parseColumnType function that takes a string representation of a ClickHouse type (e.g., FixedString(16), Nullable(Int32), etc.) and returns an AST-like object that represents the type. For example:

    for (const type of [
      'Int32',
      'Array(Nullable(String))',
      `Map(Int32, DateTime64(9, 'UTC'))`,
    ]) {
      console.log(`##### Source ClickHouse type: ${type}`)
      console.log(parseColumnType(type))
    }

    The above code will output:

    ##### Source ClickHouse type: Int32
    { type: 'Simple', columnType: 'Int32', sourceType: 'Int32' }
    ##### Source ClickHouse type: Array(Nullable(String))
    {
      type: 'Array',
      value: {
        type: 'Nullable',
        sourceType: 'Nullable(String)',
        value: { type: 'Simple', columnType: 'String', sourceType: 'String' }
      },
      dimensions: 1,
      sourceType: 'Array(Nullable(String))'
    }
    ##### Source ClickHouse type: Map(Int32, DateTime64(9, 'UTC'))
    {
      type: 'Map',
      key: { type: 'Simple', columnType: 'Int32', sourceType: 'Int32' },
      value: {
        type: 'DateTime64',
        timezone: 'UTC',
        precision: 9,
        sourceType: "DateTime64(9, 'UTC')"
      },
      sourceType: "Map(Int32, DateTime64(9, 'UTC'))"
    }
    

    While the original intention was to use this function internally for Native/RowBinaryWithNamesAndTypes data formats headers parsing, it can be useful for other purposes as well (e.g., interfaces generation, or custom JSON serializers).

    NB: currently unsupported source types to parse:

    • Geo
    • (Simple)AggregateFunction
    • Nested
    • Old/new experimental JSON
    • Dynamic
    • Variant

1.6.0

12 Sep 18:34
fa85613
Compare
Choose a tag to compare

New features

Bug fixes

  • (Node.js) Fixed unhandled exceptions produced when calling ResultSet.json if the response data was not, in fact, a valid JSON. (#311)

1.5.0 (Common, Node.js)

22 Aug 13:41
43751b0
Compare
Choose a tag to compare

New features

  • (Node.js only) 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).

1.4.1 (Node.js, Web)

07 Aug 16:53
2988c50
Compare
Choose a tag to compare

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

1.4.0 (Node.js only)

12 Jul 14:04
e78b6f0
Compare
Choose a tag to compare

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 the 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. See #290 for more details.

Improvements

  • (Node.js only) The client package now exports a utility method drainStream

1.3.0 (Common, Node.js, Web)

08 Jul 12:41
30ce583
Compare
Choose a tag to compare

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