Skip to content

Releases: CaffeinatedCoder/EFCore.ComplexIndexes

v4.0.0

Choose a tag to compare

@CaffeinatedCoder CaffeinatedCoder released this 14 Jun 18:54

What's New in Version 4.0.0

This release introduces comprehensive support for PostgreSQL 18 Temporal Constraints, allowing you to enforce temporal referential integrity directly at the database level while keeping your EF Core models clean.

  • Temporal UNIQUE Constraints (WITHOUT OVERLAPS)

    • Added the HasTemporalConstraint() builder method to define standalone temporal unique constraints over scalar keys and a period (range) column.
    • Automatically handles the injection of the required btree_gist extension during migrations.
  • Temporal FOREIGN KEY Constraints (PERIOD)

    • Added the HasTemporalForeignKey() builder method to enforce temporal referential integrity between dependent and principal entities.
    • Ensures that a dependent's period is fully covered by matching principal periods.
    • Supports composite keys and includes built-in validation to ensure matching key counts and correct range type usage.

Both features generate proper standalone DDL constraints during EF Core migrations (requires UseNpgsqlComplexIndexes()), bypassing EF's limitation on using non-comparable range types in primary keys.

Full Changelog: v3.1.5...v4.0.0

v3.1.5

Choose a tag to compare

@CaffeinatedCoder CaffeinatedCoder released this 05 Jun 16:44

What's Changed

New Features

Support for registering NpgsqlComplexIndexes with custom internal service providers

If your application builds its own IServiceProvider and passes it to .UseInternalServiceProvider(...), EF Core prevents .UseNpgsqlComplexIndexes() from modifying services. Instead, register the generator directly on your IServiceCollection:

var provider = new ServiceCollection()
    .AddEntityFrameworkNpgsql()
    .AddNpgsqlComplexIndexes() // ← Add this for expression indexes
    .BuildServiceProvider();

Full Changelog: v3.1.0...v3.1.5

v3.1.0

Choose a tag to compare

@CaffeinatedCoder CaffeinatedCoder released this 04 Jun 21:42

What's Changed

New Features

Per-column sort direction

Wrap any member in DbOrder.Desc(...) (or DbOrder.Asc(...), the default) to control its sort order. Because a wrapped member is a method call, C# requires you to name it in the anonymous type:

builder.HasComplexCompositeIndex(
    c => new { c.HybridDateTime.DateTime, Counter = DbOrder.Desc(c.HybridDateTime.Counter), c.Id },
    indexName: "IX_Commits_DateTime_Counter_Id");
// CREATE INDEX "IX_Commits_DateTime_Counter_Id" ON ... ("DateTime", "Counter" DESC, "Id");

Direction maps to EF Core's native CreateIndexOperation.IsDescending, so it is rendered by every relational provider (SQL Server, SQLite, PostgreSQL) — no extra wiring required. Re-declaring an index over the same columns updates its direction.

Full Changelog: v3.0.0...v3.1.0

v3.0.0

Choose a tag to compare

@CaffeinatedCoder CaffeinatedCoder released this 03 Jun 13:40

What's Changed

New Features

Add PostgreSQL expression index support and enhance complex index handling

  • Introduced expression index functionality for PostgreSQL, including migration SQL generation for CREATE INDEX … ((expr)).

Fixes

  • Fix phantom complex-index churn on every migrations add by @T0PP1ng in #5

New Contributors

Full Changelog: v2.0.5...v3.0.0

v2.0.5

Choose a tag to compare

@CaffeinatedCoder CaffeinatedCoder released this 14 May 06:44

Full Changelog: v2.0.2...v2.0.5

  • resolves #4

v2.0.0

Choose a tag to compare

@CaffeinatedCoder CaffeinatedCoder released this 14 Feb 07:48
  • Added a new EFCore.ComplexIndexes.PostgreSQL package with PostgreSQL-specific complex index extensions (GIN, GiST, BRIN, SP-GiST, hash, operator classes, covering columns, concurrent creation, and nulls distinct handling).
  • Introduced PostgreSQL design-time services and model differ validation to ensure only supported Npgsql annotations are used during migrations.
  • Enhanced complex index handling to carry provider-specific annotations through migrations.
  • Added solution-wide NuGet package metadata and build settings via Directory.Build.props.
  • Updated tests to cover new provider-annotation serialization and index descriptor signature changes.
  • Documented PostgreSQL support and package details in the README.

v1.0.2

Choose a tag to compare

@CaffeinatedCoder CaffeinatedCoder released this 12 Feb 16:07

Full Changelog: v1.0.1...v1.0.2

v1.0.1

Choose a tag to compare

@CaffeinatedCoder CaffeinatedCoder released this 12 Feb 10:38