Skip to content

Releases: ClickHouse/clickhouse-go

v2.40.1

30 Jul 10:18
Compare
Choose a tag to compare

What's Changed

Bug fixes 🐛

Full Changelog: v2.40.0...v2.40.1

v2.40.0

30 Jul 08:40
Compare
Choose a tag to compare

What's Changed

Enhancements 🎉

  • support database/sql scanning json into string/[]byte/json.RawMessage by @SpencerTorres in #1623

Bug fixes 🐛

Other Changes 🛠

  • Bump github.com/docker/docker from 28.3.2+incompatible to 28.3.3+incompatible by @dependabot[bot] in #1621

Full Changelog: v2.39.0...v2.40.0

v2.39.0

23 Jul 05:33
Compare
Choose a tag to compare

What's Changed

Bug fixes 🐛

Read Timeout behavior changes

This bug fix has potential to affect longer running queries, ensure you're setting clickhouse.Options ReadTimeout to a reasonable value, and that your context.WithDeadline is also set to a reasonable value. The read timeout will now be applied to all blocks, previously it was only set for the first block.

New Contributors

Full Changelog: v2.38.1...v2.39.0

v2.38.1

23 Jul 03:10
Compare
Choose a tag to compare

What's Changed

Bug fixes 🐛

Full Changelog: v2.38.0...v2.38.1

v2.38.0

22 Jul 02:26
Compare
Choose a tag to compare

What's Changed

Enhancements 🎉

Bug fixes 🐛

Other Changes 🛠

  • Bump github.com/andybalholm/brotli from 1.1.1 to 1.2.0 by @dependabot[bot] in #1581
  • Bump github.com/docker/docker from 28.2.2+incompatible to 28.3.0+incompatible by @dependabot[bot] in #1583
  • Bump go.opentelemetry.io/otel/trace from 1.36.0 to 1.37.0 by @dependabot[bot] in #1584
  • Bump github.com/docker/docker from 28.3.0+incompatible to 28.3.1+incompatible by @dependabot[bot] in #1585
  • Bump github.com/docker/docker from 28.3.1+incompatible to 28.3.2+incompatible by @dependabot[bot] in #1593
  • Bump golang.org/x/net from 0.41.0 to 0.42.0 by @dependabot[bot] in #1595
  • add HTTP wait condition for container tests by @SpencerTorres in #1604
  • include server revision in block/column parsing by @SpencerTorres in #1605
  • Bump github.com/testcontainers/testcontainers-go from 0.37.0 to 0.38.0 by @dependabot[bot] in #1603
  • docs: add client configuration options by @shivanshuraj1333 in #1598
  • Bump github.com/ClickHouse/ch-go from 0.66.1 to 0.67.0 by @dependabot[bot] in #1609

Upgrades for Dynamic / JSON

Dynamic and JSON were never fully functional in previous versions. If you exceeded the maximum types for Dynamic, the data would become unreadable since it was encoded as a single SharedVariant type. Same for JSON, if you exceeded the maximum dynamic paths the data would also become unreadable since it was stored in a SharedData structure.

In ClickHouse 25.6, a setting was added that abstracts these structures away so that clients don't have to implement them.
To begin using Dynamic and JSON to their fullest ability, upgrade to ClickHouse 25.6 along with clickhouse-go v2.38.0, and enable output_format_native_use_flattened_dynamic_and_json_serialization in your connection settings. This will allow you to read all Dynamic and JSON data, even the portions that are stored in the SharedVariant and SharedData blobs on the server.

If you are using older versions of ClickHouse, things will continue to work as before (with the previously mentioned limitations).

Feel free to create an issue in the clickhouse-go repository to report any concerns or bugs with this change.

New Contributors

Full Changelog: v2.37.2...v2.38.0

v2.37.2

23 Jun 23:31
Compare
Choose a tag to compare

What's Changed

Other Changes 🛠

Full Changelog: v2.37.1...v2.37.2

v2.37.1

17 Jun 07:36
Compare
Choose a tag to compare

What's Changed

Bug fixes 🐛

  • Fix Native API HTTP bugs by @SpencerTorres in #1578
  • Fixed critical bug with the new HTTP Native API where connections were not being released.
  • Also fixed random HTTP 400 errors with large batches over HTTP

Full Changelog: v2.37.0...v2.37.1

v2.37.0

16 Jun 18:24
Compare
Choose a tag to compare

What's Changed

Enhancements 🎉

  • Scanning Datetime and Datetime64 into int64 by @vaibhav-kt in #1560
  • Supports scanning of Array, IPv4, IPv6, and Map types into Go values that implement the sql.Scanner interface. by @zapateo in #1570
  • Support HTTP connnections in Native Go interface by @SpencerTorres in #1577 (see details at bottom of release notes!)

Bug fixes 🐛

  • fix: Prevent panic on slice map keys by @disq in #1567
  • object_json: split JSON tag to remove any trailing omitempty by @dschofie in #1547
  • fix: namedValue namedDatevalue usage error by @tosolveit in #1575
  • Fix false positives in TestInterfaceArray by @tosolveit in #1572

HTTP in ClickHouse API

This release includes a bug fix / enhancement for the "ClickHouse API" interface. Previously the only way to use HTTP was through the database/sql interface, but now you can use Protocol: clickhouse.HTTP in your clickhouse.Open options.
HTTP still has some limitations to be aware of for things like batch flushing and session context, so be cautious when switching over code to this protocol. Please report any issues you may have with this change. Native protocol shouldn't be affected, but you can downgrade to v2.36.x if you notice any issues.

New Contributors

Full Changelog: v2.36.0...v2.37.0

v2.36.0

03 Jun 20:42
Compare
Choose a tag to compare

What's Changed

Enhancements 🎉

The batch.Close() function was added to prevent connections from being leaked by the batch interface. In the previous API, it is possible that an early return (due to return err or some other cause) would cause the connection to be held until the connection timed out.

Here's an example of using this new function:

batch, err := conn.PrepareBatch(ctx, "INSERT INTO function null('x UInt64') VALUES (1)")
if err != nil { . . . }
// This defer call will make sure the batch is absolutely cleaned up before it falls out of scope.
defer batch.Close()

Users should update their code to call this new function. Depending on your insert logic you may be leaking connections if Send never gets called.

Full Changelog: v2.35.0...v2.36.0

v2.35.0

22 May 00:48
Compare
Choose a tag to compare

What's Changed

Enhancements 🎉

Full Changelog: v2.34.0...v2.35.0