ClickHouse.Driver
0.8.1
See the version list below for details.
dotnet add package ClickHouse.Driver --version 0.8.1
NuGet\Install-Package ClickHouse.Driver -Version 0.8.1
<PackageReference Include="ClickHouse.Driver" Version="0.8.1" />
<PackageVersion Include="ClickHouse.Driver" Version="0.8.1" />
<PackageReference Include="ClickHouse.Driver" />
paket add ClickHouse.Driver --version 0.8.1
#r "nuget: ClickHouse.Driver, 0.8.1"
#:package ClickHouse.Driver@0.8.1
#addin nuget:?package=ClickHouse.Driver&version=0.8.1
#tool nuget:?package=ClickHouse.Driver&version=0.8.1
ClickHouse C# client
About
Official C#/ADO.NET client for ClickHouse.
- High performance
- Supports bulk insertion
- Uses compressed binary protocol over HTTP(S)
- Available for .NET Core/Framework/Standard
Documentation
See the ClickHouse website for full documentation.
Usage examples
We have a wide range of examples, aiming to cover typical scenarios of client usage.
ClickHouse Versions
The supported versions ofthe ClickHouse database server coincide with the versions currently receiving security updates.
For the list of currently supported versions, see here.
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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. 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. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| .NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- Microsoft.Bcl.HashCode (>= 6.0.0)
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.10)
- Microsoft.IO.RecyclableMemoryStream (>= 3.0.1)
- NodaTime (>= 3.2.2)
- System.Net.Http (>= 4.3.4)
- System.Text.Json (>= 9.0.10)
-
.NETFramework 4.8
- Microsoft.Bcl.HashCode (>= 6.0.0)
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.10)
- Microsoft.IO.RecyclableMemoryStream (>= 3.0.1)
- NodaTime (>= 3.2.2)
- System.Net.Http (>= 4.3.4)
- System.Text.Json (>= 9.0.10)
-
.NETStandard 2.1
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.10)
- Microsoft.IO.RecyclableMemoryStream (>= 3.0.1)
- NodaTime (>= 3.2.2)
- System.Text.Json (>= 9.0.10)
-
net10.0
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.10)
- Microsoft.IO.RecyclableMemoryStream (>= 3.0.1)
- NodaTime (>= 3.2.2)
-
net6.0
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.10)
- Microsoft.IO.RecyclableMemoryStream (>= 3.0.1)
- NodaTime (>= 3.2.2)
- System.Text.Json (>= 9.0.10)
-
net8.0
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.10)
- Microsoft.IO.RecyclableMemoryStream (>= 3.0.1)
- NodaTime (>= 3.2.2)
- System.Text.Json (>= 9.0.10)
-
net9.0
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.10)
- Microsoft.IO.RecyclableMemoryStream (>= 3.0.1)
- NodaTime (>= 3.2.2)
NuGet packages (14)
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 |
|
|
linq2db.LINQPad
Supported databases: IBM DB2 LUW/zOS, Firebird, IBM Informix, Microsoft Access, Microsoft Sql Server (+Azure), Microsoft Sql Server Compact, MySql, MariaDB, Oracle, PostgreSQL, SQLite, SAP HANA, SAP/Sybase ASE, ClickHouse. |
|
|
ClickHouse.Facades
Raw SQL migrations and contexts for ClickHouse |
|
|
Serilog.Sinks.ClickHouse
Serilog sink for ClickHouse |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on ClickHouse.Driver:
| Repository | Stars |
|---|---|
|
linq2db/linq2db
Linq to database provider.
|
v0.8.1
---
**Improvements:**
* Fixed NuGet readme file.
v0.8.0
---
**Breaking Changes:**
* Trying to set ClickHouseConnection.ConnectionString will now throw a NotSupportedException. Create a new connection with the desired settings instead.
* When a default database is not provided, the client no longer uses "default" (now uses empty string). This allows default user database settings to function as expected.
* ClickHouseDataSource.Logger (ILogger) property has been removed.
* Removed support for loading configuration from environment variables (CLICKHOUSE_DB, CLICKHOUSE_USER, CLICKHOUSE_PASSWORD). Use connection strings or ClickHouseClientSettings instead.
* The default PooledConnectionIdleTimeout has been changed to 5 seconds, to prevent issues with half-open connections when using ClickHouse Cloud (where the default server-side idle timetout is 10s).
**New Features/Improvements:**
* Added .NET 10 as a target.
* The NuGet package is now signed.
* Enabled strong naming for the library.
* Added a new way to configure ClickHouseConnection: the ClickHouseClientSettings class. You can initialize it from a connection string, or simply by setting its properties.
* Added settings validation to prevent incorrect configurations.
* Added logging in the library, enable it by passing a LoggerFactory through the settings. Logging level configuration is configured through the factory. For more info, see the documentation: https://clickhouse.com/docs/integrations/csharp#logging-and-diagnostics
* Added EnableDebugMode setting to ClickHouseClientSettings for low-level .NET network tracing (.NET 5+). When enabled, traces System.Net events (HTTP, Sockets, DNS, TLS) to help diagnose network issues. Requires ILoggerFactory with Trace-level logging enabled. WARNING: Significant performance impact - not recommended for production use.
* AddClickHouseDataSource now automatically injects ILoggerFactory from the service provider when not explicitly provided.
* Improvements to ActivitySource for tracing: stopped adding tags when it was not necessary (thanks to @verdie-g), and made it configurable through ClickHouseDiagnosticsOptions.
* Added new AddClickHouseDataSource extension methods that accept ClickHouseClientSettings for strongly-typed configuration in DI scenarios.
* Added new AddClickHouseDataSource extension method that accepts IHttpClientFactory for better DI integration.
* Optimized response header parsing.
* Added list type conversion, so List<T> can now be passed to the library (converts to Array() in ClickHouse). Thanks to @jorgeparavicini.
* Optimized EnumType value lookups.
* Avoid unnecessarily parsing the X-ClickHouse-Summary headers twice. Thanks to @verdie-g.
* Added the ability to pass a query id to ClickHouseConnection.PostStreamAsync(). Thanks to @dorki.
* The user agent string now also contains information on the host operating system, .NET version, and processor architecture.
**Bug fixes:**
* Fixed a crash when processing a tuple with an enum in it.
* Fixed a potential sync-over-async issue in the connection. Thanks to @verdie-g.
* Fixed a bug with parsing table definitions with parametrized json fields. Thanks to @dorki.