CmdScale.EntityFrameworkCore.TimescaleDB
10.2.0
dotnet add package CmdScale.EntityFrameworkCore.TimescaleDB --version 10.2.0
NuGet\Install-Package CmdScale.EntityFrameworkCore.TimescaleDB -Version 10.2.0
<PackageReference Include="CmdScale.EntityFrameworkCore.TimescaleDB" Version="10.2.0" />
<PackageVersion Include="CmdScale.EntityFrameworkCore.TimescaleDB" Version="10.2.0" />
<PackageReference Include="CmdScale.EntityFrameworkCore.TimescaleDB" />
paket add CmdScale.EntityFrameworkCore.TimescaleDB --version 10.2.0
#r "nuget: CmdScale.EntityFrameworkCore.TimescaleDB, 10.2.0"
#:package CmdScale.EntityFrameworkCore.TimescaleDB@10.2.0
#addin nuget:?package=CmdScale.EntityFrameworkCore.TimescaleDB&version=10.2.0
#tool nuget:?package=CmdScale.EntityFrameworkCore.TimescaleDB&version=10.2.0
CmdScale.EntityFrameworkCore.TimescaleDB
CmdScale.EntityFrameworkCore.TimescaleDB (aka Eftdb) is an EntityFrameworkCore provider for TimescaleDB. It lets you interact with TimescaleDB in a type-safe way with rich IntelliSense support, so you don't have to write SQL in magic strings like you did with plain Npgsql - all without losing a single feature of Npgsql.
Learn more about Eftdb in the documentation
π¦ Installation
For a typical project, install both packages:
dotnet add package CmdScale.EntityFrameworkCore.TimescaleDB
dotnet add package CmdScale.EntityFrameworkCore.TimescaleDB.Design
| Package | Description |
|---|---|
CmdScale.EntityFrameworkCore.TimescaleDB |
Runtime support for EF Core + TimescaleDB |
CmdScale.EntityFrameworkCore.TimescaleDB.Design |
Design-time support for EF Core tooling (dotnet ef migrations and scaffolding) |
You do NOT have to install Npgsql.EntityFrameworkCore.PostgreSQL β it is referenced transitively via CmdScale.EntityFrameworkCore.TimescaleDB.
β© Quick Start
1. Enable TimescaleDB
Chain .UseTimescaleDb() after .UseNpgsql() when configuring your DbContext. This registers all components that make EF Core aware of TimescaleDB's features.
string? connectionString = builder.Configuration.GetConnectionString("Timescale");
builder.Services.AddDbContext<TimescaleContext>(options =>
options.UseNpgsql(connectionString).UseTimescaleDb());
2. Define a Hypertable
You can either use the Fluent API or Data Annotations.
Fluent API
public class WeatherData
{
public Guid Id { get; set; }
public DateTime Time { get; set; }
public double Temperature { get; set; }
public double Humidity { get; set; }
}
public class WeatherDataConfiguration : IEntityTypeConfiguration<WeatherData>
{
public void Configure(EntityTypeBuilder<WeatherData> builder)
{
builder.HasKey(x => new { x.Id, x.Time });
builder.IsHypertable(x => x.Time)
.WithChunkTimeInterval("7 days");
}
}
Data Annotations
[Hypertable(nameof(Time), ChunkTimeInterval = "7 days")]
[PrimaryKey(nameof(Id), nameof(Time))]
public class WeatherData
{
public Guid Id { get; set; }
public DateTime Time { get; set; }
public double Temperature { get; set; }
public double Humidity { get; set; }
}
3. Create and Apply a Migration
With the Design package installed, you can generate the migration with the default dotnet ef tools, just like you're used to.
dotnet ef migrations add "AddWeatherData"
dotnet ef database update
π Release strategy
Eftdb targets the latest .NET LTS release. Support follows a rolling two-version model:
| Support Level | Scope |
|---|---|
| Current LTS | New features and bug fixes |
| Previous LTS | Critical bug fixes only |
Example: When .NET 12 (LTS) releases, it becomes the development target. .NET 10 receives only critical fixes, and .NET 8 support ends.
This policy balances maintainability with ensuring the most widely-used .NET versions receive support.
Questions or Ideas?
If you have questions, ideas, or need help getting started, feel free to open an issue. Weβre happy to help and discuss!
Thank you for contributing! π
| 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
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 10.0.3)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on CmdScale.EntityFrameworkCore.TimescaleDB:
| Package | Downloads |
|---|---|
|
CmdScale.EntityFrameworkCore.TimescaleDB.Design
Provides crucial design-time extensions. This package enhances the EF Core CLI tools (dotnet ef) to understand TimescaleDB concepts, enabling correct schema generation for migrations and scaffolding. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.2.0 | 1,631 | 8/19/2026 |
| 10.1.2 | 3,455 | 7/24/2026 |
| 10.1.1 | 6,108 | 6/12/2026 |
| 10.1.0 | 292 | 6/11/2026 |
| 10.0.5 | 11,878 | 5/13/2026 |
| 10.0.4 | 2,068 | 5/6/2026 |
| 10.0.3 | 16,908 | 4/3/2026 |
| 10.0.2 | 6,292 | 2/25/2026 |
| 10.0.1 | 8,389 | 2/5/2026 |
| 10.0.0 | 15,792 | 12/15/2025 |
| 0.3.3 | 7,097 | 11/27/2025 |
| 0.3.2 | 268 | 11/26/2025 |
| 0.3.1 | 1,089 | 11/17/2025 |
| 0.3.0 | 1,043 | 11/7/2025 |
| 0.2.4 | 1,000 | 11/4/2025 |
| 0.2.3 | 266 | 11/3/2025 |
| 0.2.2 | 263 | 11/3/2025 |
| 0.2.1 | 224 | 10/31/2025 |
| 0.2.0 | 1,436 | 9/24/2025 |
| 0.1.5 | 1,664 | 8/28/2025 |