Skip to content

Fix relation enumeration naming for 0.10 (breaking change) - #111

Open
bazer wants to merge 1 commit into
masterfrom
codex/fix-relation-enumeration
Open

Fix relation enumeration naming for 0.10 (breaking change)#111
bazer wants to merge 1 commit into
masterfrom
codex/fix-relation-enumeration

Conversation

@bazer

@bazer bazer commented Aug 30, 2026

Copy link
Copy Markdown
Owner

IImmutableRelation<T> enumerates rows, but its AsEnumerable() instance member returns primary-key/row pairs and hides the standard LINQ extension. The same-looking call therefore changes both the element type and loading timing unexpectedly.

This PR renames that member to AsKeyValuePairs() on the public interface, runtime implementation, and existing mock. Standard LINQ relation.AsEnumerable() now exposes the existing row sequence without loading at the call. AsKeyValuePairs() retains the previous keyed behavior, including possible synchronous loading and dictionary construction.

This is an intentional breaking change for 0.10. Consumers must recompile, pair-consuming calls must use AsKeyValuePairs(), and custom implementations must implement the renamed member. Audit inferred calls even when they still compile: they can now yield rows instead of pairs. No obsolete alias is retained because it would continue hiding the standard extension.

The PR contains only the runtime rename and regression coverage. Async implementation, package changes, and the ongoing planning/migration documentation are excluded. The existing mock's unimplemented operations remain outside this change.

Validation:

  • Interface and concrete row-view binding, I/O-free view construction, empty relations, keyed lookup identity, and composite keys: 8/8 focused compliance cases passed across SQLite file and in-memory targets.
  • DataLinq runtime builds passed for net8.0, net9.0, and net10.0 with zero warnings/errors.
  • git diff --check passed. Validation ran against the matching source files in the existing checkout; the three transferred PR files were compared with those files before committing.
  • Server-backed provider runs and packed ApiCompat verification were not run for this narrow change.

Commands run from the repository root:

.\scripts\dotnet-sandbox.ps1 run --project src/DataLinq.Testing.CLI --no-build -- run --suite compliance --targets 'sqlite-file,sqlite-memory' --filter '/*/*/MultipleForeignKeyRelationTests/*' --output failures
.\scripts\dotnet-sandbox.ps1 run --project src/DataLinq.Testing.CLI --no-build -- run --suite compliance --targets 'sqlite-file,sqlite-memory' --filter '/*/*/EmployeesRelationAndThreadingTests/Relations_*' --output failures
.\scripts\dotnet-sandbox.ps1 run --project src/DataLinq.Dev.CLI --no-build -- build src/DataLinq/DataLinq.csproj --no-restore --output summary

Related to #107; this does not complete the async workstream.

Rename the keyed AsEnumerable member to AsKeyValuePairs on the relation
interface, implementation, and existing mock. This restores standard LINQ
AsEnumerable binding to rows while retaining explicit primary-key/row
enumeration and its existing synchronous loading behavior.

Extend relation compliance tests to cover interface and concrete row views,
deferred loading, empty relations, keyed identity, and composite keys.
This is an intentional source and binary breaking change for 0.10.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant