Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
dotnet-version: "10.0.x"

- name: Restore dependencies
run: dotnet restore
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
- name: Setup .NET SDK (for NuGet publish)
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
dotnet-version: "10.0.x"

- name: NuGet login (OIDC → temp API key)
id: login
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
dotnet-version: '10.0.x'

- name: Restore dependencies
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
dotnet-version: "10.0.x"

- name: Restore dependencies
run: dotnet restore
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/Eftdb.Benchmarks/Eftdb.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>CmdScale.EntityFrameworkCore.TimescaleDB.Benchmarks</AssemblyName>
Expand All @@ -14,9 +14,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.15.2" />
<PackageReference Include="Testcontainers.PostgreSql" Version="4.7.0" />
<PackageReference Include="Z.EntityFramework.Extensions.EFCore" Version="9.103.9.3" />
<PackageReference Include="BenchmarkDotNet" Version="0.15.8" />
<PackageReference Include="Testcontainers.PostgreSql" Version="4.9.0" />
<PackageReference Include="Z.EntityFramework.Extensions.EFCore" Version="10.105.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Eftdb.Benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This project uses **BenchmarkDotNet** to measure the performance of high-through

## Prerequisites

- .NET 8 SDK or later
- .NET 10 SDK or later
- Docker

## Run the Benchmarks
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>CmdScale.EntityFrameworkCore.TimescaleDB.Samples.CodeFirst</AssemblyName>
<RootNamespace>CmdScale.EntityFrameworkCore.TimescaleDB.Samples.CodeFirst</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="EFCore.NamingConventions" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.10" />
<PackageReference Include="EFCore.NamingConventions" Version="10.0.0-rc.2" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</ItemGroup>

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>CmdScale.EntityFrameworkCore.TimescaleDB.Samples.DatabaseFirst</AssemblyName>
Expand Down
2 changes: 1 addition & 1 deletion samples/Eftdb.Samples.Shared/Eftdb.Samples.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</ItemGroup>

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>CmdScale.EntityFrameworkCore.TimescaleDB.Samples.Shared</AssemblyName>
Expand Down
6 changes: 3 additions & 3 deletions src/Eftdb.Design/Eftdb.Design.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>CmdScale.EntityFrameworkCore.TimescaleDB.Design</AssemblyName>
<RootNamespace>CmdScale.EntityFrameworkCore.TimescaleDB.Design</RootNamespace>
<PackageId>CmdScale.EntityFrameworkCore.TimescaleDB.Design</PackageId>
<Version>0.3.3</Version>
<Version>0.4.0</Version>
<Authors>CmdScale</Authors>
<Description>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.</Description>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand All @@ -24,7 +24,7 @@
<PackageTags>timescaledb;timescale;efcore;ef-core;entityframeworkcore;postgresql;postgres;time-series;timeseries;data;database;efcore-provider;provider;design;migrations;scaffolding;codegen;cli;tools</PackageTags>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.0" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\assets\cmd-nuget-logo.jpg">
Expand Down
8 changes: 4 additions & 4 deletions src/Eftdb/Eftdb.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>CmdScale.EntityFrameworkCore.TimescaleDB</AssemblyName>
<RootNamespace>CmdScale.EntityFrameworkCore.TimescaleDB</RootNamespace>
<PackageId>CmdScale.EntityFrameworkCore.TimescaleDB</PackageId>
<Version>0.3.3</Version>
<Version>0.4.0</Version>
<Authors>CmdScale</Authors>
<Description>The core runtime library. You include this in your project to enable TimescaleDB-specific features when configuring your DbContext.</Description>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down Expand Up @@ -38,6 +38,6 @@
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.0" />
</ItemGroup>
</Project>
14 changes: 7 additions & 7 deletions tests/Eftdb.FunctionalTests/Eftdb.FunctionalTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>CmdScale.EntityFrameworkCore.TimescaleDB.FunctionalTests</AssemblyName>
Expand All @@ -16,12 +16,12 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.21" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational.Specification.Tests" Version="8.0.21" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite" Version="9.0.4" />
<PackageReference Include="Npgsql.NetTopologySuite" Version="9.0.4" />
<PackageReference Include="Testcontainers.PostgreSql" Version="4.8.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="10.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational.Specification.Tests" Version="10.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite" Version="10.0.0" />
<PackageReference Include="Npgsql.NetTopologySuite" Version="10.0.0" />
<PackageReference Include="Testcontainers.PostgreSql" Version="4.9.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.assert" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);

b.Property<int>("Bar")
.HasColumnType("integer");

b.Property<string>("Description")
.HasColumnType("text");

b.HasKey("Id");

b.ToTable("Foos");
b.ToTable("Table1");
});
#pragma warning restore 612, 618
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ public TimescaleDbMigrationsInfrastructureTests(TimescaleMigrationsFixture fixtu
Fixture.ListLoggerFactory.Clear();
}

protected override Task ExecuteSqlAsync(string value)
{
((TimescaleTestStore)Fixture.TestStore).ExecuteScript(value);
return Task.CompletedTask;
}

[ConditionalFact]
public override void Can_diff_against_2_1_ASP_NET_Identity_model()
{
Expand All @@ -100,6 +106,22 @@ public override void Can_diff_against_2_2_model()
DiffSnapshot(new EfCore22ModelSnapshot(), context);
}

/// <summary>
/// PostgreSQL/Npgsql doesn't support applying migrations within an externally-managed transaction.
/// This is a known limitation - see https://github.com/npgsql/efcore.pg/issues/3407
/// </summary>
[ConditionalFact]
public override void Can_apply_two_migrations_in_transaction()
=> Assert.ThrowsAny<Exception>(() => base.Can_apply_two_migrations_in_transaction());

/// <summary>
/// PostgreSQL/Npgsql doesn't support applying migrations within an externally-managed transaction.
/// This is a known limitation - see https://github.com/npgsql/efcore.pg/issues/3407
/// </summary>
[ConditionalFact]
public override Task Can_apply_two_migrations_in_transaction_async()
=> Assert.ThrowsAnyAsync<Exception>(() => base.Can_apply_two_migrations_in_transaction_async());

[ConditionalFact]
public override void Can_diff_against_3_0_ASP_NET_Identity_model()
{
Expand Down
38 changes: 23 additions & 15 deletions tests/Eftdb.FunctionalTests/Utils/TimescaleTestStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Microsoft.EntityFrameworkCore.TestUtilities;
using Npgsql;
using System.Collections.Concurrent;
using System.Data;
using System.Data.Common;

namespace CmdScale.EntityFrameworkCore.TimescaleDB.FunctionalTests.Utils;
Expand All @@ -11,37 +12,44 @@ public class TimescaleTestStore : RelationalTestStore
{
private static readonly ConcurrentDictionary<string, TimescaleTestStore> _sharedStores = new();

protected override DbConnection Connection { get => base.Connection; set => base.Connection = value; }
public override string ConnectionString { get => base.ConnectionString; protected set => base.ConnectionString = value; }

private TimescaleTestStore(string name, bool shared, string connectionString)
: base(name, shared)
: base(name, shared, new NpgsqlConnection(connectionString))
{
ConnectionString = connectionString;
Connection = new NpgsqlConnection(ConnectionString);
}

public static TimescaleTestStore Create(string name, string connectionString)
=> new(name, shared: false, connectionString);

public static TimescaleTestStore GetOrCreateShared(string name, string connectionString)
=> _sharedStores.GetOrAdd(name, _ =>
=> _sharedStores.GetOrAdd(name, key =>
{
TimescaleTestStore store = new(name, shared: true, connectionString);

DbContextOptions<MigrationsInfrastructureFixtureBase.MigrationsContext> options = new DbContextOptionsBuilder<MigrationsInfrastructureFixtureBase.MigrationsContext>()
.UseNpgsql(connectionString).UseTimescaleDb().Options;
store.Initialize(null, () => new MigrationsInfrastructureFixtureBase.MigrationsContext(options), null);
DbContextOptions<MigrationsInfrastructureFixtureBase.MigrationsContext> options =
new DbContextOptionsBuilder<MigrationsInfrastructureFixtureBase.MigrationsContext>()
.UseNpgsql(connectionString).UseTimescaleDb().Options;
_ = store.InitializeAsync(null,
() => new MigrationsInfrastructureFixtureBase.MigrationsContext(options), null).Result;
return store;
});

public override DbContextOptionsBuilder AddProviderOptions(DbContextOptionsBuilder builder)
=> builder.AddInterceptors(new TimescaleMigrationsTestInterceptor()).UseNpgsql(ConnectionString, options =>
{
}).UseTimescaleDb().EnableSensitiveDataLogging();
=> builder.AddInterceptors(new TimescaleMigrationsTestInterceptor()).UseNpgsql(ConnectionString, options => { })
.UseTimescaleDb().EnableSensitiveDataLogging();

public override void Clean(DbContext context)
public override Task CleanAsync(DbContext context)
{
context.Database.EnsureClean();
return Task.CompletedTask;
}

public void ExecuteScript(string script)
{
if (ConnectionState != ConnectionState.Open)
Connection.Open();

using DbCommand cmd = Connection.CreateCommand();
cmd.CommandText = script;
cmd.ExecuteNonQuery();
}
}
}
12 changes: 6 additions & 6 deletions tests/Eftdb.Tests/Eftdb.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>CmdScale.EntityFrameworkCore.TimescaleDB.Tests</AssemblyName>
Expand All @@ -16,11 +16,11 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="EFCore.NamingConventions" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.8" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
<PackageReference Include="EFCore.NamingConventions" Version="10.0.0-rc.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Testcontainers.PostgreSql" Version="4.8.1" />
<PackageReference Include="Testcontainers.PostgreSql" Version="4.9.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
Expand Down
Loading