Repository navigation
Description
From #85, decided 2026-11-12: a path has to be able to name a property of a derived type that shares the declaring type's table (((Stay)x).GuestId on Reservation). Two sibling types may each have a property of one name, so the stored path has to say which type it means. To settle before epoch 1 freezes.
2026-11-12, merged (PR #70, closed #69): renames. The resolver takes EF Core's renames for the source side of a diff: SQL and dependencies take the target's table and column names, a default name is still built from the source's own. Still open here: JSON members (with #25, #27), TPC, the corpus (#33) and store facts, and the two ported limits to decide before epoch 1 is frozen.
2026-11-12, merged (#59, closed #58): the first slice. SchemaResolver has Column(path), Template(sql) and Name(declared, prefix, parts), and every SqlFragment records what it reads (Dependencies: the columns of its placeholders, or the whole table for SQL without one). The kernel's resolver reads metadata only and is tested on a configured model and on its compiled snapshot alike, on Npgsql, SQL Server and SQLite. The API takes paths and templates as the declaration holds them; Target(KeyTarget) and Predicate(…) from the design come with the declaration values of the first provider vocabulary.
Still open here:
- JSON members and the JSON container as a column, rendered as the provider's queries render them and asserted against
ToQueryString()(with PgExclusion: exclusion constraints end to end #25, PgIndex: typed indexes with expression and JSON-member keys and typed filters #27). Until then a path into a JSON-mapped complex type is refused. - Renames: the source side resolving under the names the inner differ's
RenameTableOperationandRenameColumnOperationgive (with Change planning and impact: SchemaChange, BaseChange, ImpactOf, dependencies #24). - TPC: the tables a declaration lands on, each copy resolved against that table's entity type, and the refusal of a member with no column in a derived table. The mapping check through the property's own table mappings belongs here.
- The corpus triple per rule and epoch (Golden corpus per renderer epoch, with snapshot fixtures #33), and store facts of a target.
To decide before epoch 1 is frozen by a release. Two rules are ported from 5.x with their known limits:
- The converter-member check compares types only, so a second member of the stored type (
Email.Alias, also astring) resolves to the column likeEmail.Value. - Only single quotes are tracked in a template. A
{Path}inside a double-quoted identifier, a dollar-quoted string or a comment is replaced.
A gap in the backlog, found while writing the handoff of 2026-11-11: the resolver is named in the plan and the design and in the bodies of #7, #24 and #27, and no issue owns it. In 5.x it is the largest and most fragile part of the differ.
Problem
A declaration holds property paths and templates. A descriptor holds identifiers and SQL. Something has to turn one into the other, once per table and identically for both sides of a diff, and it is where most of the 5.x bugs lived: a snapshot that has no converters, a renamed table or column, a JSON member rendered differently from the query that should use the index, a column that no longer exists.
Change
SchemaResolver, handed to a contributor's Resolve (design, section 9.4; plan, section 3.5):
Table,Target(KeyTarget) → SqlFragment,Predicate(…) → SqlFragment,Name(declared, prefix, parts) → Identifier(the default-name rule, length-checked through the dialect), and the store facts of a target.- It walks EF's relational model with
StoreObjectIdentifier: complex-type columns andHasColumnName, the converter-member unwrap, the property-bag rule for snapshots, JSON members rendered as the provider's queries render them, the JSON container as a plain column, placeholders outside single-quoted literals only. - The mapping is the declared property's, found through the property and the store object, never
IColumn.PropertyMappings[0]. - Epochs: each declaration carries its resolution epoch
r; an unknown epoch is an error; the golden corpus (Golden corpus per renderer epoch, with snapshot fixtures #33) fails a change without a new one. - Renames: the source side resolves under the table and column names the inner differ's
RenameTableOperationandRenameColumnOperationgive, so a rename does not rebuild what reads the column. - Every fragment records the columns it reads, which is what
ImpactOf(Change planning and impact: SchemaChange, BaseChange, ImpactOf, dependencies #24) is asked about. Raw SQL without placeholders depends on every column of its table. - TPC: where a declaration lands (
DeclarationTablesin 5.x), and the refusals that go with it. - It is a diff-time service: it may need the model, so it is never a constructor dependency of the differ or the generator.
Done when
- A snapshot round trip (a real generated snapshot compiled with Roslyn, as 5.x's
SnapshotRoundTripTestsdoes) resolves every kind of path alike on both sides, at the top level and inside a complex type. - Each JSON-member rendering is asserted against EF Core's own
ToQueryString(). - The corpus (Golden corpus per renderer epoch, with snapshot fixtures #33) has a triple per rule and epoch.
Activity
CaffeinatedCoder commentedon Nov 14, 2026
From the pre-preview sweep of
main@ 948496a, 2026-11-14. #101 is the TPC case as a defect (a concrete root reaches one table). Beside it, what the reviews read in the resolver and did not turn into issues, for the decisions before epoch 1 is frozen. None was run unless it says so.Email.Value == "foo"is written against the column, which holds"mail:foo". And aboolstored as text:where: x => x.ActivegivesWHERE (active), which PostgreSQL refuses. A literal is written as the model's value where the template is made, with no type mapping at hand. An enum comparison is refused for that reason already.WithExpressiontext with a brace in a dollar-quoted string or a quoted identifier would have a placeholder replaced that 5.x wrote as it was.{A}with a raw"B"recordsAalone. Measured: droppingBfails with 2BP01, so it is loud, not a loss. It takes a hand-builtKeyTarget.Template.NameTokens.Ofkeeps acharbychar.IsLetterOrDigit: a supplementary letter is two surrogates and both go, and what counts as a letter moves with the runtime's Unicode tables. 5.x used the same rule on .NET 10, so a default name of 5.x and one computed here can differ for a character assigned in between. That is a rename nobody asked for, not a loss.DeclarationCodec.Foldupper-cases with the runtime's tables for a key underIgnoreCase. No declaration of today uses it; the first that does has a key that can move with the runtime, the classCanonicalJsonwas written against.SplitToTable) resolves against its main table only: a column in the other fragment is refused, and nothing selects the fragment. Read, not run.