Repository navigation
Closed
Labels
area/migrationsThe differ and generator decorators, snapshot format, EnsureCreated and the UseSchemaKit wiringenhancementNew feature or requestpackage/coreAffects CodoMetis.EFCore.SchemaKit (the kernel)
Milestone
Description
The first slice of #43, cut so that the planner (#24) and the exclusion-constraint contributor (#25) have something to resolve with. #43 stays open for the rest.
Problem
SchemaResolver is an abstract shell with Table, Dialect and Sql, and the only implementation is the tests' stand-in. A contributor's Resolve cannot turn a property path or a template into SQL, so no real contributor can be written.
Change
In the kernel, provider-neutral:
SchemaResolver.Column(path): a dotted property path to its column in the resolver's table, through the declared property and the table'sStoreObjectIdentifier. Complex types are walked;HasColumnNameis honoured because the leaf property is asked. One segment past a scalar property (Email.Value) resolves to the whole column only when the property has a converter whose provider type is the member's type; on a snapshot, which rebuilds types as property bags and drops converters, an indexer property is taken as it is.SchemaResolver.Template(sql): SQL with{Path}placeholders, replaced by the delimited column outside single-quoted literals only. A brace pair that is not a property path stays as written.SchemaResolver.Name(declared, prefix, parts): the declared name, or{prefix}_{table}_{tokens}, length-checked by the dialect. A part's token is kept apart from its SQL, so a change of rendering does not rename an object.- Every fragment records what it reads: the columns of its placeholders, or the whole table for SQL without one (plan, section 3.7). Composition through
SchemaSql.FragmentandSchemaSql.Listkeeps it. - An unknown resolution epoch is refused. Epoch 1 is the only one.
- The kernel's resolver is made by an internal diff-time service, never a constructor dependency of the differ or the generator.
Not in this slice (stays in #43)
- JSON members and the JSON container as a column: the rendering is the provider's, so it arrives with the PostgreSQL package (PgExclusion: exclusion constraints end to end #25, PgIndex: typed indexes with expression and JSON-member keys and typed filters #27). A path into a JSON-mapped complex type is refused until then.
- Renamed tables and columns: the source side resolving under the names the inner differ's operations give needs the planner (Change planning and impact: SchemaChange, BaseChange, ImpactOf, dependencies #24).
- TPC: the tables a declaration lands on, and the refusals that go with it.
- The golden corpus per epoch (Golden corpus per renderer epoch, with snapshot fixtures #33).
KeyTargetandPredicateas declaration values, which come with the first provider vocabulary.
Done when
- Every kind of path and a template resolve to the same fragment, the same dependencies and the same default name on a configured model and on its generated snapshot compiled with Roslyn, on Npgsql, SQL Server and SQLite.
- Each rule is shown to fail a test when undone.
Metadata
Metadata
Assignees
Labels
area/migrationsThe differ and generator decorators, snapshot format, EnsureCreated and the UseSchemaKit wiringenhancementNew feature or requestpackage/coreAffects CodoMetis.EFCore.SchemaKit (the kernel)
Activity