Repository navigation
Description
Problem
On the 11 line, exclusion constraints come from CodoMetis.EFCore.SchemaKit.PostgreSQL. Its Overlaps takes Npgsql's own types only (NpgsqlRange<T>, its nullable form, NpgsqlRange<T>[] and List<NpgsqlRange<T>>), so a column of this package is written through the unchecked form:
pg.Exclusion(pg.Equal(x => x.RoomId).WithUncheckedOperator(x => x.Period, "&&")) // Period : DateRangeWithUncheckedOperator takes any type and any operator, and PostgreSQL says what is wrong only when the migration is applied. SchemaKit's design gives the typed form to a satellite in this repository (design, section 10.2, decision Q12 of its plan), and its plan names that satellite as the first package outside its repository to compile against it, in its preview.3.
Change (main only)
A fifth package, src/CodoMetis.ValueRanges.EFCore.PostgreSQL.SchemaKit/, for net11.0:
- It references this repository's EF package and
CodoMetis.EFCore.SchemaKit.PostgreSQL. Nothing else here references SchemaKit, so the EF package keeps no SchemaKit dependency. - Extension members on SchemaKit's
ExclusionDraft<TEntity>andExclusionElements<TEntity>: oneOverlapsper range type and per range set type, each built onWithUncheckedOperator(…, "&&"). Thenpg.Equal(x => x.RoomId).Overlaps(x => x.Period)compiles for aDateRange, andOverlaps(x => x.Name)doesn't. - No contributor, no differ and no generator: the package writes no SQL of its own.
MigrationServiceOwnershipConventionTestsholds that as it does for the other four. - While SchemaKit is a preview, the reference names one version exactly. Its previews change the API and the stored form between them (
preview.2refuses a snapshot scaffolded withpreview.1). - Its own
CHANGELOG.md, a package README and a section indocs/efcore.md. The cross-tests and the smoke consumer of main: re-enable the cross-tests and the joint smoke consumer against CodoMetis.EFCore.SchemaKit.PostgreSQL #333 move from the unchecked form to the typed one.
Packaging. A stable package can't depend on a prerelease (NU5104), and v11.0.0 doesn't wait for SchemaKit (#147). So this package ships as 11.0.0-preview.N with the other four while Version is a prerelease, and is left out of the pack when Version is stable and SchemaKit is not. The conventions, the changelog checks, the release-notes target and the smoke test discover every project under src/ and assume one Version for all of them, so the hold-back is one explicit rule with a test that fails without it (seed: pack a stable version with the prerelease reference in place). #541 ships the package as a stable one.
To decide
- The NodaTime types. No range interface is free of the element type (
IRange<T>,IRangeFactory<TRange, T>), and C# doesn't inferTfrom a constraint, so one genericOverlaps<TRange>can't cover every range today. With an overload per type, the four NodaTime ranges and their sets need a reference toCodoMetis.ValueRanges.NodaTime: either this package takes it and every user gets NodaTime, or there is a sixth package. A non-generic marker interface in the core would let one overload cover all of them, as an addition to the core's surface. - A constraint that starts with the range. In
preview.2,PgSchema<TEntity>hasEqualandOverlapsand noWithUncheckedOperator; only the two stage types have it. If there is no other public way in,pg.Overlaps(x => x.Period)as the first element can't be written from outside, and that is an issue for SchemaKit. - Which operators. SchemaKit has
Overlapsonly.-|-and the others stay withWithUncheckedOperatorunless a use turns up.
What it does not show
SchemaKit's contract freezes at rc.1, after a contributor outside its repository has compiled against it (CaffeinatedCoder/CodoMetis.EFCore.SchemaKit#120). This package is vocabulary only. It compiles against the declaration surface and never touches SchemaContributor<,>, Plan or ImpactOf, so it doesn't stand in for that contributor.
Blocked by
- Per-domain range set types (Int32RangeSet, DateRangeSet, …) replace RangeSet<TRange, T> #275: the per-domain range set types decide the overload list.
- main: re-enable the cross-tests and the joint smoke consumer against CodoMetis.EFCore.SchemaKit.PostgreSQL #333: the cross-tests this package then retypes.
- A SchemaKit preview on nuget.org that restores beside this line's Npgsql floor.
preview.2does, once main: move the EF Core and Npgsql floors to 11.0.0 #533 is in.
Done when
11.0.0-preview.Nof the package is on nuget.org beside the other four.- A compile probe holds that
Overlapsover a property that isn't a range or range set of this package does not compile. - The exclusion cross-tests use the typed form and reject an overlap on PostgreSQL 16 and 18.
- A stable
Versionpacks four packages while SchemaKit is a prerelease, and a test fails when the fifth is packed with it.
As built (#592)
- The NodaTime types: the package references
CodoMetis.ValueRanges.NodaTimeand has an overload per type, NodaTime's included (13 range types, 13 range set types). Every user of the package gets NodaTime; no sixth package and no core marker interface. Open for the maintainer to confirm before 11.0.0. - A constraint that starts with the range:
PgSchema<TEntity>hasWithUncheckedOperatorsince SchemaKitpreview.3, sopg.Overlaps(x => x.Period)is in the package too. No SchemaKit issue needed. - Which operators:
Overlapsonly. - Pin:
[11.0.0-preview.3]in the PR; it moves to[11.0.0-preview.4]once that is on nuget.org (the stage types are unchanged on SchemaKitmainsince preview.3). - Packaging: not packable at a stable
VersionwhileSchemaKitVersionis a prerelease;PackagingConventionTestsevaluates every project at both kinds ofVersion, and the smoke test checks the feed.
Activity
Merge pull request #592 from CaffeinatedCoder/feat/540-schemakit-sate…