EntityFrameworkCore.ClickHouse
3.0.1
dotnet add package EntityFrameworkCore.ClickHouse --version 3.0.1
NuGet\Install-Package EntityFrameworkCore.ClickHouse -Version 3.0.1
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="EntityFrameworkCore.ClickHouse" Version="3.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EntityFrameworkCore.ClickHouse" Version="3.0.1" />
<PackageReference Include="EntityFrameworkCore.ClickHouse" />
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 EntityFrameworkCore.ClickHouse --version 3.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EntityFrameworkCore.ClickHouse, 3.0.1"
#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 EntityFrameworkCore.ClickHouse@3.0.1
#: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=EntityFrameworkCore.ClickHouse&version=3.0.1
#tool nuget:?package=EntityFrameworkCore.ClickHouse&version=3.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

ClickHouse provider for Entity Framework Core
Quick start
- Create console app
- Install the necessary packages
dotnet add package EntityFrameworkCore.ClickHouse
dotnet add package Spectre.Console.Cli
class MyFirstTable
{
public uint UserId { get; set; }
public string Message { get; set; }
public DateTime Timestamp { get; set; }
public float Metric { get; set; }
}
class QuickStartDbContext : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
base.OnConfiguring(optionsBuilder);
optionsBuilder.UseClickHouse("Host=localhost;Protocol=http;Port=8123;Database=QuickStart");
}
public DbSet<MyFirstTable> MyFirstTable { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
var entityTypeBuilder = modelBuilder.Entity<MyFirstTable>();
entityTypeBuilder.Property(e => e.UserId).HasColumnName("user_id");
entityTypeBuilder.Property(e => e.Message).HasColumnName("message");
entityTypeBuilder.Property(e => e.Timestamp).HasColumnName("timestamp");
entityTypeBuilder.Property(e => e.Metric).HasColumnName("metric");
entityTypeBuilder.HasKey(e => new { e.UserId, e.Timestamp });
entityTypeBuilder.ToTable("my_first_table", table => table
.HasMergeTreeEngine()
.WithPrimaryKey("user_id", "timestamp"));
}
}
class Program
{
static async Task Main(string[] args)
{
await using var context = new QuickStartDbContext();
await context.Database.EnsureCreatedAsync();
await context.MyFirstTable.AddRangeAsync(
new MyFirstTable
{
UserId = 101,
Message = "Hello, ClickHouse!",
Timestamp = DateTime.Now,
Metric = -1f
},
new MyFirstTable
{
UserId = 102,
Message = "Insert a lot of rows per batch",
Timestamp = DateTime.Now.AddDays(-1),
Metric = 1.41421f
},
new MyFirstTable
{
UserId = 102,
Message = "Sort your data based on your commonly-used queries",
Timestamp = DateTime.Today,
Metric = 2.718f
},
new MyFirstTable
{
UserId = 101,
Message = "Granules are the smallest chunks of data read",
Timestamp = DateTime.Now.AddSeconds(5),
Metric = 3.14159f
});
await context.SaveChangesAsync();
var data = context.MyFirstTable.OrderBy(e => e.Timestamp).ToArray();
var table = new Table()
.AddColumns(
new TableColumn("user_id").RightAligned(),
new TableColumn("message").LeftAligned(),
new TableColumn("timestamp").RightAligned(),
new TableColumn("metric").RightAligned());
Array.ForEach(data, d => table.AddRow(
d.UserId.ToString(),
d.Message,
d.Timestamp.ToString(CultureInfo.InvariantCulture),
d.Metric.ToString(CultureInfo.InvariantCulture)));
AnsiConsole.Write(table);
}
}
┌─────────┬────────────────────────────────────────────────────┬─────────────────────┬─────────┐
│ user_id │ message │ timestamp │ metric │
├─────────┼────────────────────────────────────────────────────┼─────────────────────┼─────────┤
│ 102 │ Insert a lot of rows per batch │ 04/29/2024 21:05:26 │ 1.41421 │
│ 102 │ Sort your data based on your commonly-used queries │ 04/30/2024 00:00:00 │ 2.718 │
│ 101 │ Hello, ClickHouse! │ 04/30/2024 21:05:26 │ -1 │
│ 101 │ Granules are the smallest chunks of data read │ 04/30/2024 21:05:31 │ 3.14159 │
└─────────┴────────────────────────────────────────────────────┴─────────────────────┴─────────┘
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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.
-
net10.0
- ClickHouse.Driver (>= 0.9.0)
- Microsoft.EntityFrameworkCore (>= 10.0.1)
- Microsoft.EntityFrameworkCore.Abstractions (>= 10.0.1)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on EntityFrameworkCore.ClickHouse:
| Package | Downloads |
|---|---|
|
IoTSinol.Data.ClickHouse
Package Description |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on EntityFrameworkCore.ClickHouse:
| Repository | Stars |
|---|---|
|
IoTSharp/IoTSharp
IoTSharp is an open-source IoT platform for data collection, processing, visualization, and device management.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.1 | 504 | 12/9/2025 |
| 3.0.0 | 905 | 11/16/2025 |
| 2.0.1 | 10,490 | 8/16/2025 |
| 2.0.0 | 4,936 | 8/9/2025 |
| 1.0.2 | 10,577 | 3/23/2025 |
| 1.0.1 | 6,231 | 1/19/2025 |
| 1.0.0 | 8,161 | 11/22/2024 |
| 0.0.22 | 59,943 | 11/7/2024 |
| 0.0.20 | 41,671 | 8/1/2024 |
| 0.0.19 | 8,398 | 7/19/2024 |
| 0.0.18 | 4,876 | 7/18/2024 |
| 0.0.17 | 4,849 | 7/16/2024 |
| 0.0.16 | 5,797 | 6/19/2024 |
| 0.0.15 | 6,329 | 4/30/2024 |
| 0.0.14 | 4,830 | 4/29/2024 |
| 0.0.13 | 5,400 | 4/8/2024 |
| 0.0.12 | 5,160 | 4/7/2024 |
| 0.0.11 | 5,143 | 4/7/2024 |
| 0.0.10 | 7,379 | 11/16/2023 |
| 0.0.9 | 20,626 | 4/12/2022 |
| 0.0.8 | 5,536 | 11/1/2021 |
| 0.0.7 | 5,391 | 8/29/2021 |
## v3.0.1
- Updated ClickHouse.Driver to version 0.9.0
- Updated dependencies to Entity Framework Core 10.0.1
- Explicitly throw exceptions for unsupported ClickHouse features
- Change `char` type mapping from `FixedString(1)` to `String`
Full release notes: https://github.com/denis-ivanov/EntityFrameworkCore.ClickHouse/releases/tag/v3.0.1