EntityFrameworkCore.ClickHouse
3.0.3
dotnet add package EntityFrameworkCore.ClickHouse --version 3.0.3
NuGet\Install-Package EntityFrameworkCore.ClickHouse -Version 3.0.3
<PackageReference Include="EntityFrameworkCore.ClickHouse" Version="3.0.3" />
<PackageVersion Include="EntityFrameworkCore.ClickHouse" Version="3.0.3" />
<PackageReference Include="EntityFrameworkCore.ClickHouse" />
paket add EntityFrameworkCore.ClickHouse --version 3.0.3
#r "nuget: EntityFrameworkCore.ClickHouse, 3.0.3"
#:package EntityFrameworkCore.ClickHouse@3.0.3
#addin nuget:?package=EntityFrameworkCore.ClickHouse&version=3.0.3
#tool nuget:?package=EntityFrameworkCore.ClickHouse&version=3.0.3

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. |
-
net10.0
- ClickHouse.Driver (>= 0.9.0)
- Microsoft.EntityFrameworkCore (>= 10.0.3)
- Microsoft.EntityFrameworkCore.Abstractions (>= 10.0.3)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.3)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on EntityFrameworkCore.ClickHouse:
| Package | Downloads |
|---|---|
|
Archetypical.Software.Vega.Api.Abstractions
This package provides a turn-key API and DBContext for any REST and ODATA exposed data models. These models also allow for automated DBContexts across multiple db technologies. Full OTEL support and swagger/redoc tooling |
|
|
IoTSharp.Data.ClickHouse
Package Description |
|
|
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.3 | 46,665 | 2026/2/11 |
| 3.0.2 | 2,178 | 2026/1/22 |
| 3.0.1 | 8,714 | 2025/12/9 |
| 3.0.0 | 3,875 | 2025/11/16 |
| 2.0.1 | 176,647 | 2025/8/16 |
| 2.0.0 | 9,891 | 2025/8/9 |
| 1.0.2 | 16,501 | 2025/3/23 |
| 1.0.1 | 9,664 | 2025/1/19 |
| 1.0.0 | 16,577 | 2024/11/22 |
| 0.0.22 | 128,150 | 2024/11/7 |
| 0.0.20 | 74,213 | 2024/8/1 |
| 0.0.19 | 11,244 | 2024/7/19 |
| 0.0.18 | 7,625 | 2024/7/18 |
| 0.0.17 | 7,602 | 2024/7/16 |
| 0.0.16 | 8,638 | 2024/6/19 |
| 0.0.15 | 9,151 | 2024/4/30 |
| 0.0.14 | 7,584 | 2024/4/29 |
| 0.0.13 | 8,581 | 2024/4/8 |
| 0.0.12 | 7,919 | 2024/4/7 |
## v3.0.3
- Updated dependencies to Entity Framework Core 10.0.3
Full release notes: https://github.com/denis-ivanov/EntityFrameworkCore.ClickHouse/releases/tag/v3.0.3