clickhouse
Official Rust client for ClickHouse DB
0.15.1
12M downloads/mo
#2867 most downloaded on crates.io
ClickHouse/clickhouse-rs
What this package is like to depend on
Last release 2 months ago
04 Jun 2026
Ships fairly regularly
a new release about every 2 months
Nearly every release is documented
notes for 45 of 45 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
45 releases · first in 2017
6 releases in the last 12 months
see the full history below
Release timeline
45 releases · May 2017 to Jun 2026Releases
latest 45-
0.15.104 Jun 2026Release notes
Open source →Added
- Introduced support for Apache Arrow in Rust via a new extension crate,
clickhouse-ext-arrow. (#423)- The CHANGELOG for this new crate is tracked in ext-arrow/CHANGELOG.md.
- See examples/arrow.rs for usage.
- Added
BytesCursor::poll_next()(#423)
Fixed
- Introduced support for Apache Arrow in Rust via a new extension crate,
-
0.15.006 Apr 2026Release notes
Open source →Added
- Deprecated
::*_option()methods in favor of::*_setting()(#380)- This is to match the terminology used by ClickHouse Server.
- Added support for
zstdcompression (#388) - Added support for
tracingand OpenTelemetry trace propagation to ClickHouse (#390)- See examples/opentelemetry.rs for usage.
- Exposed
X-ClickHouse-Summaryfields from server response (#397)- Added
RowCursor::summary()andBytesCursor::summary()which is populated once the response from the server is received, containing potentially useful statistics about the query.
- Added
Changed
- Dropped abandoned
fxhashandlinked-hash-mapdev-dependencies (#403)
- Deprecated
-
0.14.330 Mar 2026Release notes
Open source →Added
- Added support for
SimpleAggregateFunctiontype (#394)
Fixed
- Fixed serialization of
Option::NonewithQuery::param()(#385) - Fixed handling of
Jsontype with type hints (#387) - Fixed
Insertfor temporary tables and qualified table names (#391) - Updated
lz4_flexto get fix for RUSTSEC-2026-0041 (#396)
- Added support for
-
0.14.214 Jan 2026Release notes
Open source →Added
- Added
Client::insert_formatted_with()andInsertFormattedfor inserting data in a chosen format with a specified SQL query. (#364)InsertFormatteddoes not buffer data by default, allowing precise control over when the data is sent. For best performance, ensure data is sent in larger chunks or use.buffered()to getBufInsertFormattedwhich implements buffering.- Data may optionally be pre-compressed and buffered separately using
CompressedData::new()andInsertFormatted::send_compressed(). BufInsertFormattedalso implementstokio::io::AsyncWritefor composability.
- Added
Client::set_optionto modify options through&mut Client(#375) - Added
Client::get_optionto read previously set options (#375) - Added support for binding byte-strings as server-side params (#376)
- This means passing types to
Query::paramthat callSerializer::serialize_bytes()are now supported. - Note that
Vec<u8>and&[u8]serialize as an array of integers. Use a specialized type, e.g.bytes::Bytesorserde_bytes::Bytesto bind a byte-string.
- This means passing types to
- Implemented
Primitiveforbytes::Bytesandbytes::BytesMut(#376)- These can be used to fetch byte-strings as a scalar value, e.g. with
Query::fetch_one().
- These can be used to fetch byte-strings as a scalar value, e.g. with
Fixed
- Implemented parsing for the new exception tagging format in ClickHouse 25.11 (#365)
- Fixed a doc comment on
clickhouse::serde::chrono::date(#371)
Changed
- (CI-only change) added scheduled runs against
clickhouse-server:headtag, reworked secrets access (#367) Queryno longer sets thereadonlyoption by default. (#377)- This was previously added in [#342] to simulate the default read-only restriction
when issuing queries via
GETrequests, but had poor interaction with settings profiles that setreadonly="2".
- This was previously added in [#342] to simulate the default read-only restriction
when issuing queries via
- Added
-
0.14.126 Nov 2025Release notes
Open source →Added
- Implement
StreamforRowCursor. (#283, #340) - Added an optional
on_commitcallback toInserter. (#307) - Added
with_roleandwith_default_rolesmethods toClient,Query,Insert, andInserter, allowing to explicitly set the roles for executed queries. (#326) - Added
Int256andUInt256ClickHouse types support. The client now provides two new convenience wrappers over[u8; 32]:clickhouse::types::Int256andclickhouse::types::UInt256. See the updated derive example. (#352)
Fixed
- When binding
u128/i128values to SQL queries using server-side params, the client now correctly serializes them as strings without adding an unnecessary cast. (#322) - Fixed an issue where the schema validation could fail with custom
JSONtypes such asJSON(max_dynamic_paths=64, max_dynamic_types=8). (#350, Steffen911)
Changed
- Optimize
RowCursorby reusing buffer capacity where possible. (#340) - All
Query::fetch*methods will always use POST instead of GET. It is now allowed to changereadonlyvalue viaQuery::with_option. (#342) - In case of a schema mismatch, the client now emits
clickhouse::error::Error::SchemaMismatchinstead of panicking. (#346) - Removed replace_with, static_assertions, and sealed from the crate dependencies. (#353)
- Implement
-
0.14.008 Oct 2025Release notes
Open source →Removed
- BREAKING watch:
Client::watch()API is removed (#245). - BREAKING mock:
watch()andwatch_only_events()are removed (#245).
Changed
- BREAKING insert: the type of
Insert<_>should now be specified when callingclient.insert::<_>(). (#247) - BREAKING insert:
Client::insert()is now async. (#244) - BREAKING inserter:
Inserter::write()is now async. (#244) - BREAKING inserter:
Inserter::new()return justSelfinstead ofResult<Self>. (#244) - BREAKING query:
RowBinaryWithNamesAndTypesis now used by default for query results. This may cause panics if the row struct definition does not match the database schema. UseClient::with_validation(false)to revert to the previous behavior which uses plainRowBinaryformat for fetching rows. (#221, #244) - BREAKING mock: when using
test-utilfeature, it is now required to useClient::with_mock(&mock)to set up the mock server, so it properly handles the response format and automatically disables parsingRowBinaryWithNamesAndTypesheader parsing and validation. Additionally, it is not required to callwith_urlexplicitly. See the updated example. - BREAKING query:
Query::fetch_bytes()now expectsimpl AsRef<str>forformatinstead ofInto<String>. Most usages should not be affected, however, unless passing a custom type that implements the latter but not the former. (#311) - query: due to
RowBinaryWithNamesAndTypesformat usage, there might be an impact on fetch performance, which largely depends on how the dataset is defined. If you notice decreased performance, consider disabling validation by usingClient::with_validation(false). - serde: it is now possible to deserialize Map ClickHouse type into
HashMap<K, V>(orBTreeMap,IndexMap,DashMap, etc.). - tls: improved error messages in case of missing TLS features when using HTTPS (#229).
- crate: MSRV is now 1.79 due to borrowed rows support redesign in #247.
- crate: bumped dependencies, see #232, #239 and #280 for additional details.
- crate: starting from 0.3.0,
clickhouse-deriveis now published asclickhouse-macroson crates.io. The formerclickhouse-derivecrate is discontinued. (#318).
Added
- types: added support for
TimeandTime64types (#258). - client: added
Client::with_validationbuilder method. Validation is enabled by default, meaning thatRowBinaryWithNamesAndTypesformat will be used to fetch rows from the database. If validation is disabled,RowBinaryformat will be used, similarly to the previous versions. (#221). - types: a new crate
clickhouse-typeswas added to the project workspace. This crate is required forRowBinaryWithNamesAndTypesstruct definition validation, as it contains ClickHouse data types AST, as well as functions and utilities to parse the types out of the ClickHouse server response. (#221). - query: support serializing
serde_bytes::Bytesas hex string literals in query parameters (#250). - derive: added
#[clickhouse(crate = "...")]attribute for#[derive(Row)](#189, #292)
Fixed
- client: extract the exception code from
X-ClickHouse-Exception-Codein case of incorrect 200 OK response that could occur with ClickHouse server up to versions 24.x (#256). - query: pass format as
?default_formatURL parameter instead of usingFORMATclause, allowing queries to have trailing comments and/or semicolons (#267, #269, #311).
- BREAKING watch:
-
0.13.329 May 2025Release notes
Open source →Added
- client: added
Client::with_access_tokento support JWT authentication ClickHouse Cloud feature (#215). - Identifier: added
CopyandClonederive (#224).
Fixed
- client: added
-
0.13.212 Mar 2025Release notes
Open source →Added
- query: added
Query::with_paramto support server-side parameters binding (#159) - derive: added Variant data type support (#170).
- query: added
Query::fetch_bytesthat allows streaming data in an arbitrary format (#182) - serde: added support for chrono (#188)
Changed
- MSRV is now 1.73 due to changes in
bstrandhyper-rustlsdependencies (#180).
Fixed
- query/cursor: return
NotEnoughDataif a row is unparsed when the stream ends (#185).
- query: added
-
0.13.121 Oct 2024Release notes
Open source →Added
- query/cursor: add
RowCursor::{decoded_bytes,received_bytes}methods (#169).
Changed
- query/cursor: improve performance of
RowCursor::next()(#169).
Fixed
- mock: work with the advanced time via
tokio::time::advance()(#165).
- query/cursor: add
-
0.13.027 Sep 2024Release notes
Open source →Added
- query: add
Query::sql_display()(#155). - client: add
Client::with_product_info()(#135). - client: add the
User-Agentheader to all requests (#135).
Changed
- MSRV is now 1.70 due to changes in hyper-rustls v0.27.3.
- tls: revise HTTPS-related features, see README for details (#140,#141,#156).
- query: support
??for escaping the?symbol in SQL (#154).
Fixed
- query: add
-
0.12.220 Aug 2024Release notes
Open source →Changed
- Now this crate is pure Rust, no more C/C++ dependencies.
- insert: increase max size of frames to improve throughput (#130).
- compression: replace
lz4sys binding withlz4-flex(pure Rust). - compression: replace
clickhouse-rs-cityhash-syssys binding withcityhash-rs(pure Rust) (#107).
Deprecated
- compression:
Compression::Lz4Hcis deprecated and becomes an alias toCompression::Lz4.
-
0.12.107 Aug 2024Release notes
Open source →Added
- query/bind: support
Optioninquery.bind(arg)(#119, #120). - client:
Client::with_header()to provide custom headers (#98, #108). - query: added
Query::with_option()similar toClient::with_option()(#123). - insert: added
Insert::with_option()similar toClient::with_option()(#123). - inserter: added
Inserter::with_option()similar toClient::with_option()(#123).
Changed
- insert: the outgoing request is now created after the first
Insert::writecall instead ofInsert::new(#123).
- query/bind: support
-
0.12.016 Jul 2024Release notes
Open source →Added
- derive: support
serde::skip_deserializing(#83). - insert: apply options set on the client (#90).
- inserter: can be limited by size, see
Inserter::with_max_bytes(). - inserter:
Inserter::pending()to get stats about still being inserted data. - inserter:
Inserter::force_commit()to commit and insert immediately. - mock: impl
Defaultinstance forMock.
Changed
- BREAKING bump MSRV to 1.67.
- BREAKING replace the
tlsfeature withnative-tlsandrustls-tlsthat must be enabled explicitly now. - BREAKING http:
HttpClientAPI is changed due to moving to hyper v1. - BREAKING inserter: move under the
inserterfeature. - BREAKING inserter: there is no default limits anymore.
- BREAKING inserter:
Inserter::writeis synchronous now. - BREAKING inserter: rename
entriestorows. - BREAKING drop the
wa-37420feature. - BREAKING remove deprecated items.
- BREAKING mock:
provide(),watch()andwatch_only_events()now accept iterators instead of streams. - inserter: improve performance of time measurements by using
quanta. - inserter: improve performance if the time limit isn't used.
- derive: move to syn v2.
- mock: return a request if no handler is installed (#89, #91).
Fixed
- watch: support a new syntax.
- uuid: possible unsoundness.
- query: avoid panics during
Query::bind()calls (#103).
- derive: support
-
0.11.627 Sep 2023 -
0.11.512 Jun 2023Release notes
Open source → -
0.11.414 May 2023Release notes
Open source →Added
- query:
Query::fetch_optional().
Changed
- query: increase performance up to 40%.
- query:
-
0.11.319 Feb 2023Release notes
Open source →Added
- client: support HTTPS (#54).
Changed
- query: improve throughput (~8%).
Fixed
- cursor: handle errors sent at the end of a response (#56).
-
0.11.203 Jan 2023Release notes
Open source →Added
- insert:
with_timeoutsto manage timeouts. - inserter:
with_timeoutsandset_timeoutsto manage timeouts.
Changed
- insert: improve throughput (~30%).
- inserter: set a default value of
max_entriesto 500_000.
- insert:
-
0.11.125 Nov 2022Release notes
Open source →Added
- ipv4:
serde::ipv4for ser/de theIPv4type to/fromIpv4Addr. Note thatIPv6requires no annotations. - time:
serde::time::datetime(64)for ser/de thetime::OffsetDateTimetype to/fromDateTimeandDateTime64. - time:
serde::time::date(32)for ser/de thetime::Datetype to/fromDateandDate32. - serde: add
::optionvariants to supportOption<_>.
Changed
- uuid: move to the
serdesubmodule.
- ipv4:
-
0.11.010 Nov 2022Release notes
Open source →Added
- compression: implement Lz4/Lz4Hc compression modes for
INSERTs (#39). - insert: the
wa-37420feature to avoid ClickHouse#37420. - inserter: new method
Inserter::time_left(). - uuid: the
uuidfeature and a corresponding module to ser/deuuid::Uuid(#26).
Changed
- BREAKING decompression: HTTP compression (gzip, zlib and brotli) isn't available anymore, only Lz4.
- inserter: skip timer ticks if
INSERTis too long (#20).
- compression: implement Lz4/Lz4Hc compression modes for
-
0.10.018 Jan 2022Release notes
Open source →Added
- client:
Client::with_http_clientto use customhyper::Client, e.g. for https (#27).
Changed
- watch: run
WATCHqueries withmax_execution_time=0. - bind: implement
Bindfor allSerializeinstances (#33).
Fixed
- Implement
Primitiveforf64(#31).
- client:
-
0.9.321 Dec 2021Release notes
Open source →Added
- Implement
Primitiveforf64andf32(#29).
Fixed
- Reset quantities on errors to support reusing
Inserterafter errors (#30).
- Implement
-
0.9.201 Nov 2021Release notes
Open source →Changed
- HTTP Keep-alive timeout is restricted to 2s explicitly.
Fixed
- watch: make a cursor cancellation safe.
-
0.9.125 Oct 2021Release notes
Open source →Added
- mock: add
record_ddlhandler to test DDL queries. - mock: add
watchandwatch_only_eventshandlers to test WATCH queries.
- mock: add
-
0.9.025 Oct 2021Release notes
Open source →Fixed
- query: support borrowed long strings (#22).
- query: read the whole response of DDL queries.
Changed
- BREAKING: watch: require the
watchfeature. - BREAKING: watch: only struct rows are allowed because JSON requires names.
- query: queries with invalid URLs fail with
Error::InvalidParams. - watch: use
JSONEachRowWithProgressbecause of ClickHouse#22996 (#23).
-
0.8.126 Aug 2021 -
0.8.028 Jul 2021 -
0.7.207 Jul 2021Release notes
Open source →Added
Watch::refresh()to specifyREFRESHclause.
Fixed
derive(Row): handle raw identifiers.
-
0.7.129 Jun 2021Release notes
Open source →Fixed
- Get rid of "socket is not connected" errors.
Changed
- Set TCP keepalive to 60 seconds.
-
0.7.031 May 2021Release notes
Open source →Changed
- Replace
reflection::Reflectionwithclickhouse::Row. It's enough to implementRowfor top-levelstructs only.
Added
#[derive(Row)]
- Replace
-
0.6.828 May 2021 -
0.6.728 May 2021Release notes
Open source →Fixed
- docs: show features on docs.rs.
- Now
test-utilimplieshyper/server.
-
0.6.628 May 2021Release notes
Open source →Added
testmodule (available with thetest-utilfeature).#[must_use]forQuery,Watch,InsertandInserter.
-
0.6.524 May 2021 -
0.6.414 May 2021 -
0.6.311 May 2021Release notes
Open source →Added
- Support for
boolvalues storage (#9). arrays' binding to SQL queries — useful atINoperators, etc (#9).Stringvalues binding to SQL queries (#9).Query::fetch_all()sql::Identifier
Changed
- Expose
query::Bind(#11). - Deprecate
Compression::encoding().
- Support for
-
0.6.212 Apr 2021 -
0.6.109 Apr 2021 -
0.6.020 Jan 2021 -
0.5.122 Nov 2020 -
0.5.019 Nov 2020 -
0.4.017 Nov 2020Release notes
Open source →Added
Query::fetch_one(),Watch::fetch_one().Query::fetch()as a replacement forQuery::rows().Watch::fetch()as a replacement forWatch::rows().Watch::only_events().fetch()as a replacement forWatch::events().
Changed
ErrorisStdError + Send + Sync + 'staticnow.
-
0.3.028 Oct 2020Release notes
Open source →Added
- Expose cursors (
query::RowCursor,watch::{RowCursor, EventCursor}).
- Expose cursors (
-
0.2.026 Oct 2020Release notes
Open source →Added
Client::inserter()for infinite inserting into tables.Client::watch()forLIVE VIEWrelated queries.
Changed
- Renamed
Query::fetch()toQuery::rows(). - Use
GETrequests forSELECTstatements.
-
0.1.017 May 2017Release notes
Open source →Added
- Support basic types.
Client::insert()for inserting into tables.Client::query()for selecting from tables and DDL statements.
<!-- next-url --> [Unreleased]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.15.1...HEAD [0.15.1]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.15.0...v0.15.1 [0.15.0]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.14.3...v0.15.0 [0.14.3]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.14.2...v0.14.3 [0.14.2]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.14.1...v0.14.2 [0.14.1]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.14.0...v0.14.1 [0.14.0]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.13.3...v0.14.0 [0.13.3]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.13.2...v0.13.3 [0.13.2]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.13.1...v0.13.2 [0.13.1]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.13.0...v0.13.1 [0.13.0]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.12.2...v0.13.0 [0.12.2]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.12.1...v0.12.2 [0.12.1]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.12.0...v0.12.1 [0.12.0]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.11.6...v0.12.0 [0.11.6]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.11.5...v0.11.6 [0.11.5]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.11.4...v0.11.5 [0.11.4]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.11.3...v0.11.4 [0.11.3]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.11.2...v0.11.3 [0.11.2]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.11.1...v0.11.2 [0.11.1]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.11.0...v0.11.1 [0.11.0]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.10.0...v0.11.0 [0.10.0]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.9.3...v0.10.0 [0.9.3]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.9.2...v0.9.3 [0.9.2]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.9.1...v0.9.2 [0.9.1]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.9.0...v0.9.1 [0.9.0]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.8.1...v0.9.0 [0.8.1]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.8.0...v0.8.1 [0.8.0]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.7.2...v0.8.0 [0.7.2]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.7.1...v0.7.2 [0.7.1]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.7.0...v0.7.1 [0.7.0]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.6.8...v0.7.0 [0.6.8]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.6.7...v0.6.8 [0.6.7]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.6.6...v0.6.7 [0.6.6]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.6.5...v0.6.6 [0.6.5]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.6.4...v0.6.5 [0.6.4]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.6.3...v0.6.4 [0.6.3]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.6.2...v0.6.3 [0.6.2]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.6.1...v0.6.2 [0.6.1]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.6.0...v0.6.1 [0.6.0]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.5.1...v0.6.0 [0.5.1]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.5.0...v0.5.1 [0.5.0]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.4.0...v0.5.0 [0.4.0]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.3.0...v0.4.0 [0.3.0]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.2.0...v0.3.0 [0.2.0]: https://github.com/ClickHouse/clickhouse-rs/compare/v0.1.0...v0.2.0 [0.1.0]: https://github.com/ClickHouse/clickhouse-rs/releases/tag/v0.1.0