ClickHouse.Driver 1.5.0

dotnet add package ClickHouse.Driver --version 1.5.0
                    
NuGet\Install-Package ClickHouse.Driver -Version 1.5.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ClickHouse.Driver" Version="1.5.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ClickHouse.Driver" Version="1.5.0" />
                    
Directory.Packages.props
<PackageReference Include="ClickHouse.Driver" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ClickHouse.Driver --version 1.5.0
                    
#r "nuget: ClickHouse.Driver, 1.5.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ClickHouse.Driver@1.5.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ClickHouse.Driver&version=1.5.0
                    
Install as a Cake Addin
#tool nuget:?package=ClickHouse.Driver&version=1.5.0
                    
Install as a Cake Tool

ClickHouse C# client

About

Official C# client for ClickHouse. This package contains two clients:

  • HTTP client: ClickHouseClient and an ADO.NET provider for ORMs. It sends data in the RowBinary format over HTTP(S). Use it for most applications.
  • Native TCP client (experimental): ClickHouseTcpClient. It uses the ClickHouse native protocol and sends data in columnar blocks.

Documentation

Full documentation is on the ClickHouse website:

Usage examples

We have a wide range of examples, aiming to cover typical scenarios of client usage. They are grouped by client: HTTP and native TCP.

Choosing a client

HTTP Native TCP
Status Stable Experimental. The API can change in a future release.
Main API ClickHouseClient, ADO.NET (ClickHouseConnection) ClickHouseTcpClient
.NET versions 6.0 and newer 8.0 and newer
Default ports 8123 (HTTP), 8443 (HTTPS) 9000, 9440 (TLS)
Performance Fast Even faster: about 2x for typical reads and 1.5x for writes
ADO.NET and ORMs (Dapper, EF Core, linq2db) Yes No
CSV, JSONEachRow, Parquet, and raw streams Yes No
JSON performance Better: binary transfer Text transfer only
Bearer authentication and custom HTTP headers Yes No
Columnar block reads No Yes
Progress, profile, and server log callbacks No Yes
W3C trace context propagation to ClickHouse No Yes

The overview gives more information about when to use each client.

ClickHouse Versions

Both clients support the last 3 releases plus the last 2 LTS releases of the ClickHouse server.

Contact us

If you have any questions or need help, feel free to reach out to us in the Community Slack or via GitHub issues.

Contributing

Contributions are welcome and highly appreciated! Check out our contributing guide.

Acknowledgements

Originally created by Oleg V. Kozlyuk

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (30)

Showing the top 5 NuGet packages that depend on ClickHouse.Driver:

Package Downloads
EntityFrameworkCore.ClickHouse

ClickHouse provider for Entity Framework Core.

FreeSql.Provider.ClickHouse

FreeSql 数据库实现,基于 ClickHouse.Client Ado.net

Xinghe.Utility

XH基础库(内部使用)

dbup-clickhouse

DbUp makes it easy to deploy and upgrade databases. This package adds ClickHouse support.

ClickHouse.Facades

Raw SQL migrations and contexts for ClickHouse

GitHub repositories (4)

Showing the top 4 popular GitHub repositories that depend on ClickHouse.Driver:

Repository Stars
dotnetcore/FreeSql
.NET aot orm, VB.NET/C# orm, Mysql/PostgreSQL/SqlServer/Oracle orm, Sqlite/Firebird/Clickhouse/DuckDB orm, 达梦/金仓/虚谷/翰高/高斯 orm, 神通 orm, 南大通用 orm, 国产 orm, TDengine orm, QuestDB orm, MsAccess orm.
linq2db/linq2db
Linq to database provider.
dotnet/nuget-trends
Check out NuGet packages adoption and what's trending on NuGet.
sitkoru/Sitko.Core
Sitko.Core is a set of libraries to help build .NET Core applications fast
Version Downloads Last Updated
1.5.0 2,754 9/28/2026
1.4.0 84,050 9/2/2026
1.4.0-rc2 173 8/24/2026
1.4.0-rc1 123 8/18/2026
1.3.0 162,559 6/29/2026
1.3.0-rc1 353 6/24/2026
1.2.0 268,816 4/14/2026
1.1.0 252,298 3/24/2026
1.0.2 38,170 3/10/2026
1.0.1 40,835 3/3/2026
1.0.0 116,692 2/17/2026
1.0.0-rc2 318 2/12/2026
1.0.0-rc1 9,015 1/21/2026
0.9.0 182,235 12/3/2025
0.8.1 48,023 11/19/2025
0.8.0 3,429 11/19/2025
0.7.20 391,060 8/19/2025
0.7.19 125,021 8/13/2025
0.7.18 11,644 8/2/2025

v1.5.0
---

**New Features:**
* **Experimental native TCP client.** `ClickHouseTcpClient` connects to ClickHouse over the native protocol (port 9000, or 9440 with TLS). Configure it with a connection string or `ClickHouseTcpClientOptions`. It reads rows, POCOs, or columnar blocks, and inserts rows, POCOs, or typed columns. In our benchmarks against the HTTP client in v1.4.0, reads are up to 2x faster, inserts are up to 1.5x faster, and managed allocations are much lower. It ships in the `ClickHouse.Driver` package for .NET 8 and later. It is a separate API from `ClickHouseClient` and has no ADO.NET layer. The API can change in a future release, so using it causes warning `CHTCP0001`. See the [documentation](https://clickhouse.com/docs/integrations/language-clients/csharp/tcp) and the [examples](https://github.com/ClickHouse/clickhouse-cs/tree/main/examples/Tcp).

**Improvements:**
* Added `RowIndex` to `ClickHouseBulkCopySerializationException` so binary-insert failures report the zero-based index of the offending row within the batch, making it easy to locate bad data in large inserts. (Thanks to @mbtolou - #606 and @Skyuzii - #608)

**Bug Fixes:**
* Fixed a wall-clock shift when reading a `DateTime`/`DateTime64` column whose `Fixed/UTC±HH:MM:SS` timezone name has a minute or second field above 59. The server carries such a field into the next one, so `Fixed/UTC+05:60:00` means +06:00; the driver rejected the name and read the value as UTC. (#612)