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
                    
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="CmdScale.EntityFrameworkCore.TimescaleDB" Version="10.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CmdScale.EntityFrameworkCore.TimescaleDB" Version="10.2.0" />
                    
Directory.Packages.props
<PackageReference Include="CmdScale.EntityFrameworkCore.TimescaleDB" />
                    
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 CmdScale.EntityFrameworkCore.TimescaleDB --version 10.2.0
                    
#r "nuget: CmdScale.EntityFrameworkCore.TimescaleDB, 10.2.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 CmdScale.EntityFrameworkCore.TimescaleDB@10.2.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=CmdScale.EntityFrameworkCore.TimescaleDB&version=10.2.0
                    
Install as a Cake Addin
#tool nuget:?package=CmdScale.EntityFrameworkCore.TimescaleDB&version=10.2.0
                    
Install as a Cake Tool

CmdScale.EntityFrameworkCore.TimescaleDB

Test Workflow NuGet downloads codecov GitHub release (latest by date) GitHub issues GitHub license

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 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.

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,770 8/19/2026
10.1.2 3,544 7/24/2026
10.1.1 6,131 6/12/2026
10.1.0 293 6/11/2026
10.0.5 11,909 5/13/2026
10.0.4 2,071 5/6/2026
10.0.3 16,953 4/3/2026
10.0.2 6,332 2/25/2026
10.0.1 8,389 2/5/2026
10.0.0 15,829 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,044 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 225 10/31/2025
0.2.0 1,438 9/24/2025
0.1.5 1,664 8/28/2025
Loading failed