Skip to content

tests: spike F binds a declaration when the model is finalized - #181

Merged
CaffeinatedCoder merged 1 commit into
mainfrom
spike/177-binder
Nov 24, 2026
Merged

CaffeinatedCoder merged 1 commit into
mainfrom
spike/177-binder

Conversation

@CaffeinatedCoder

Copy link
Copy Markdown
Owner

Closes #177

Problem

#114 proposes to bind a lambda when the model is finalized, not where it is written, and listed four points to decide. None could be decided without knowing what a convention sees at that moment, and whether Declare's refusal of a repeated key survives.

Change

Nothing under src/ changes.

Tests

45 tests, 15 on each of Npgsql, SQL Server and SQLite, with no database. The CI lane for spikes runs every project under spikes/.

Each mechanism was removed in turn in a scratch copy, built clean:

Removed Fails
The second binding on the finalized model the late change of Q1
Captured values made constants at the call Q6, Q4 at the call, the literals of Q1
The comparison of bound texts at finalization Q4's two lambdas
The comparison at the call both refusals of Q4 at the call
The mapping source every test that builds a model
The model's nullability, with the C# annotation in its place the literals of Q1

🤖 Generated with Claude Code

For the decision on #114. A miniature kit on EF Core alone holds a
condition unbound from the call, binds it in a finalizing convention and
stores its text. 45 tests on Npgsql, SQL Server and SQLite, with no
database, say what a convention sees there: a property's final
nullability and column name, and no type mapping and no store type, so
the literal is the mapping source's. The design-time model, the runtime
model, a snapshot and a compiled model hold text alone, and a snapshot is
not bound again.

The decision taken from it on 2026-11-24 is in the plan's section 7 and
in CLAUDE.md: bound at model finalization, stored as segments. It is not
built yet.

Closes #177

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@CaffeinatedCoder CaffeinatedCoder added this to the 11.0.0 milestone Nov 24, 2026
@CaffeinatedCoder CaffeinatedCoder added tests Adds or changes tests only (harnesses, parity suites); no library code package/core Affects CodoMetis.EFCore.SchemaKit (the kernel) area/expression-indexes Expression, typed lambda and JSON member indexes labels Nov 24, 2026
@CaffeinatedCoder
CaffeinatedCoder merged commit 901c5dc into main Nov 24, 2026
11 checks passed
@CaffeinatedCoder
CaffeinatedCoder deleted the spike/177-binder branch November 24, 2026 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/expression-indexes Expression, typed lambda and JSON member indexes package/core Affects CodoMetis.EFCore.SchemaKit (the kernel) tests Adds or changes tests only (harnesses, parity suites); no library code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spike F: can a declaration be bound when the model is finalized?

1 participant