Repository navigation
Description
2026-11-24: built on the branch feat/178-segments, not committed. Offline it passes: 744 of the kernel's tests, 183 of the PostgreSQL package's, 85 of the second provider's. Live, on the driver Npgsql 11.0.0: 4 of the kernel's and 73 of the PostgreSQL package's on PostgreSQL 16 and on 18, the handover from 5.x among them; the second provider's 86 on SQL Server 2022; the consumer smoke test's 47 rows on PostgreSQL 18, packed as 11.0.0-preview.2.
What is there:
SqlTemplate, a value of segments (SqlSegment.Text,Column,Raw), stored as a list:["lower(",{"col":"Email.Value"},") = 'a'"],{"raw":…}for SQL written by hand.vis 3, and avof 2 is refused with the message that says to scaffold again.- The resolver reads segments and scans nothing. SQL written by hand reads the whole table beside its columns; a package's own text reads nothing.
Predicate.Andcomposes segments. Hand-written SQL that reads like its text is not taken for it.PgExclusionstoressqlandwhereas segments. The 5.x reader reads an expression and a filter as SQL written by hand.- Each of the seven new rules was removed in turn, and a test failed for each.
Three things are not as the issue says:
- The default name's rule is unchanged. As written here ("a column's own name, and of text the ASCII letters and digits"),
lower({first_name})would be namedlowerfirst_namewhere 5.x andpreview.1name itlowerfirstname, and every such object would be renamed at the handover from 5.x, against SchemaKit: moving from EFCore.ComplexIndexes 5.x adds no migration, or exactly the one the guide documents #10. The name is built from the segments now, by the same letters-and-digits rule as before. Making it independent of the runtime's Unicode tables needs a rule that agrees with 5.x on ASCII, and probably a new epoch: to decide. PredicateandKeyTarget.Templatehave their new public shape already, which Binder, slice 2: a declaration is held unbound until the model is finalized, then bound and checked #179 lists: they hold aSqlTemplateand are not made from a string. Storing segments left no way to keep the string.{Path}is still looked for, once, where text becomes segments:SqlTemplate.FromPlaceholdersfor the kernel's translator, which writes placeholders until Binder, slice 2: a declaration is held unbound until the model is finalized, then bound and checked #179 and Binder, slice 3: the translator takes nullability and literals from the model #180, andSqlTemplate.Rawfor a 5.x filter. Nothing stored is scanned.
Part of #114 (decided 2026-11-24). First of three slices; the translator still runs at the call.
Change
- A template is stored as an array of segments: a string is text the translator wrote and reads nothing,
{"col":"Path"}is a column by its path,{"raw":"…"}is SQL a consumer wrote and reads the whole table, also beside a column. A literal is translator text. vbecomes 3. Avof 2 is refused with a message that says to scaffold the snapshot again (SchemaKit: snapshot format v2 and CodoMetis: annotation keys ship in 11.0.0; the 5.x format is read forever (D11) #9).- The resolver reads segments: no quote counting and no brace matching (Predicate.And takes a trailing AND (x) for a top-level conjunct, whatever the precedence #83, the scanners on SchemaResolver: paths to columns and SQL, identically on both sides of a diff #43).
Predicate.Andis composition of segments, and "already added" a comparison of them.- A default name is built from the segments: a column's own name, and of text the ASCII letters and digits.
PgExclusion's stored form, the 5.x exclusion reader and the fixtures' handover follow.
Done when
The verbatim keys and values of DeclarationStoreTests and PgExclusionDeclarationTests are the new ones, the handover from the 5.x fixture still diffs to nothing and applies to the same catalog on PostgreSQL 16 and 18, and the version is 11.0.0-preview.2 with its changelog section.
Activity