Skip to content

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

Done

Description

@CaffeinatedCoder

2026-11-24: measured. spikes/F.Binder on the branch spike/177-binder: 45 tests, 15 on each provider, and each mechanism removed in turn in a scratch copy with the tests that depend on it failing. The answers are in its README; the proposal that cites them is on #114. Not committed or merged yet.

  1. Final nullability and the column name: yes. No type mapping and no store type on a property; the literal comes from the mapping source, asked of the declared property. A change by a later convention is caught by binding again on the finalized model.
  2. Text alone, in the design-time model, the runtime model, a snapshot and a compiled model.
  3. No.
  4. Yes to both. The order of writing has to be kept for the second message.
  5. Amended before finalization, bound as amended; nothing to amend after.
  6. Read at finalization unless the tree is rewritten at the call.

For #114, before its four points are decided. Throwaway code under spikes/F.Binder, on EF Core alone, on Npgsql, SQL Server and SQLite, with no database.

Questions

  1. What a finalizing convention sees. A convention added by an IConventionSetPlugin and run when the model is finalized: does it see a property's final nullability, its converter (set in OnModelCreating, by ConfigureConventions, and the provider's own for an enum), its store type and a type mapping that writes a converted literal as SQL? On each provider.
  2. An unbound declaration held on the model. A declaration stored at the call as an object, replaced by its text at finalization: is the text all that the design-time model, the runtime model, a generated snapshot and a compiled model hold?
  3. A snapshot is never bound again. Does the convention run for a model built from a snapshot?
  4. The key. Declare refuses a repeated declaration at the call. With the bound form unknown there: can the logical declaration be refused at the call, and two different lambdas that bind to one text at finalization, naming both?
  5. Redeclare and the read model before finalization, on a declaration that is not bound yet.
  6. Captured values. A lambda that reads a local which changes after the call.

Done when

Each question has a test per provider and its answer in the spike's README, and #114 carries a proposal that cites them.

Activity

  1. added this to the 11.0.0 milestone on Nov 24, 2026
  2. added
    tests
    package/core
    area/expression-indexes
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/expression-indexespackage/coretests

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions