Skip to content

PgExclusion, first slice: the PostgreSQL package, its dialect, the declaration and its contributor #76

Closed

Description

@CaffeinatedCoder

First slice of #25: the PostgreSQL package exists, and an exclusion constraint declared in a model reaches the database.

Change

  • src/CodoMetis.EFCore.SchemaKit.PostgreSQL, depending on the kernel at exactly its own version.
  • UseSchemaKit() on NpgsqlDbContextOptionsBuilder: the kernel's registration, the PostgreSQL dialect and the contributor.
  • A dialect that counts an identifier's length in UTF-8 bytes (from feat: the SQL vocabulary, statements with no hole for a string #42).
  • Kernel: KeyTarget and Predicate as public declaration values, built from a lambda by the translator.
  • PgExclusion (Gist | SpGist), ExclusionElement, ExclusionOperator, Deferral; the staged chain pg.Equal(…).Overlaps(…), pg.Exclusion(…, where:, deferral:, name:), DeclarePostgres, PgSchema.For<T>(), AndWhere.
  • The contributor: plain ADD CONSTRAINT, DROP CONSTRAINT without IF EXISTS, a rename in place, ImpactOf as measured in the plan's section 3.7.

Not in this slice

btree_gist injection, name claims across kinds (#44), the 5.x reader for CustomExclusion:Constraints (#18), Sql.Raw<T> in an element (#26), the compile probes against the shipped assemblies.

Done when

On PostgreSQL 16 and 18: EnsureCreated(), the create script and a migration built from the differ's operations each leave the constraint in the catalog; overlapping rows are refused and rows outside the filter are not; a model against its own compiled snapshot diffs to nothing.

Activity

  1. added this to the 11.0.0 milestone on Nov 12, 2026
  2. added
    enhancement
    package/core
    package/postgresql
    area/constraints
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/constraintsenhancementpackage/corepackage/postgresql

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions