ClickHoused 0.1.2: native ClickHouse client for D (ddbc and HibernateD support coming)
Vadim Lopatin
coolreader.org at gmail.com
Mon Nov 2 08:25:31 UTC 2026
On Thursday, 29 October 2026 at 21:26:21 UTC, Vadim Lopatin wrote:
> I'd like to announce **ClickHouseD**, a new client library for
> [ClickHouse](https://clickhouse.com), the open-source
> column-oriented database for analytics.
UPDATE: clickhoused 0.2.0 – 0.6.0: TLS, all column types, DDBC
driver, performance
Since the 0.1.2 announcement, clickhoused, the native D client
for ClickHouse (native TCP protocol, pure D, works with threads
and vibe.d fibers), had five more releases. They are on
code.dlang.org (https://code.dlang.org/packages/clickhoused); the
full changelog is in the repository:
https://github.com/buggins/clickhoused/blob/main/CHANGELOG.md
**0.2.0: TLS**
- Secure connections (port 9440) in thread and fiber mode:
`secure=true` in the connection string or
`ConnectionOptions.secure`, with CA file, client certificates
(certificate-based login), SNI and `skip_verify` for development.
- OpenSSL 1.1.1 or 3.x is loaded at run time, only when the first
secure connection is made: no extra dependency or build
configuration for applications that don't use TLS. Trusted
certificates come from the system store (also the Windows store
on Windows).
**0.3.0: composite and extended types**
- `Array(T)`, `Tuple(...)` (named too), `Map(K, V)`, native
`LowCardinality(T)`, `Decimal(P, S)` up to `Decimal256`,
`Int128`/`UInt128`/`Int256`/`UInt256`, `IPv4`/`IPv6`.
- They map to D types in struct mapping and inserts: arrays to
`T[]`, tuples to structs or `std.typecons.Tuple`, maps to
associative arrays, plus value types `Decimal`, `Int128`…,
`IPv4`, `IPv6`.
**0.4.0: more types**
- Geo types (`Point`, `Ring`, `LineString`, `Polygon`,
`MultiPolygon`, ...) with a `GeoPoint` value type, `BFloat16`,
`Time`/`Time64` (as `core.time.Duration`, or `TimeOfDay`).
- Fixed: `Float32`/`Float64` values as text now match the server
exactly (the shortest decimal that reads back as the same value).
**0.5.0: Variant, Dynamic, JSON, Nested**
- `Variant(...)` (and `Geometry`), `Dynamic` and the new `JSON`
type (as JSON text, with `std.json.JSONValue` mapping), and
`Nested` with `flatten_nested = 0`.
- With this, every ClickHouse column type we planned is
supported. `std.variant.Variant` maps to any column.
**0.6.0: performance**
- A new benchmark suite (`dub run :bench -b release`) found six
hot spots; fixing them, without breaking changes, made SELECTs of
typical columns about 4–5 times faster (about 6 times with LZ4
compression), row-by-row inserts and `query!T` struct mapping
about 3 times, and float-to-text conversion 10–20 times.
- Against a release ClickHouse 26.8 server, numeric results come
in as fast as with ClickHouse's own `clickhouse-client`; results
with strings take about 1.5–2 times its time. Numbers and method:
https://github.com/buggins/clickhoused/blob/main/doc/benchmarks.md
**DDBC support**
DDBC (https://github.com/buggins/ddbc) now has a ClickHouse
driver built on clickhoused: use the `ClickHouse` configuration
and a URL such as
`ddbc:clickhouse://localhost:9000/default?user=default`. It came
with DDBC 0.8.0 and was updated with every clickhoused release
since (DDBC 0.8.1–0.8.5; 0.8.2 also lets the PostgreSQL and ODBC
drivers read many more column types). The versions are tagged and
released on GitHub, but code.dlang.org does not import new DDBC
versions automatically and still lists 0.7.0. Until it does, you
can depend on the release commit directly (dub wants the commit
hash here; this is v0.8.5):
```json
"dependencies": {
"ddbc": { "repository":
"git+https://github.com/buggins/ddbc.git", "version":
"f584cb83c30818b693ab47cf1172ac51074f12de" }
},
"subConfigurations": { "ddbc": "ClickHouse" }
```
clickhoused is BSL-1.0, needs a D frontend 2.097 or newer (DMD
2.097+, LDC 1.27+, GDC 12+), and is tested against ClickHouse
23.8 to the latest release on Linux, Windows and macOS. It is an
unofficial project, not affiliated with ClickHouse, Inc.
Next: an API review and freeze towards 1.0. Feedback, issues and
pull requests are welcome: https://github.com/buggins/clickhoused
More information about the Digitalmars-d-announce
mailing list