Repository navigation
Reads: sequential access is opt-in with SequentialAccess() - #269
Merged
Merged
Conversation
The library reads every query with the default access mode. It no longer asks for `CommandBehavior.SequentialAccess` on its own: mapped reads (`Map<T>()`, `AsObjectArrays()`, `AsDictionaryRows()`), `AnyAsync`, `CountAsync`, `LoadTable` and `LoadTables` did, and `ToDataTable` and `ToDataTables` on an `IDbCommand` had it as the default of their `behavior` parameter, which is now `CommandBehavior.Default`. New: `SequentialAccess()`, one fluent opt-in. - On a command it applies to every reader the command opens from then on: reader callbacks, the `Map` terminals and the `DataTable` terminals. It stays on the command, and the caller's own flags stay. - It is also on the mapped views (`MappedCommand`, `MappedQuery` and its `Skip` and `Take` forms) and the mapped definitions (`MappedDbQuery`). - There is no attribute and no per-model or generator setting. Use it for very large text or binary values, above all one value copied as a stream with `reader.GetStream`. A selector given to `Map` must then read the columns in ascending order, or the provider throws. With `AsyncReads()` on a very large value, opt in: raw SqlClient with `Default` and `ReadAsync` took 48.0 s against 8.86 s for one 100 MB value; the library with default access was not measured. Docs: the XML docs and a compiled sample show the streaming case; the benchmark and async-read pages say which figures were measured with sequential access; release note. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
electricessence
force-pushed
the
feat/sequential-access-opt-in
branch
from
December 1, 2026 00:19
e608e86 to
8bc9754
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The library reads every query with the default access mode. It no longer asks for
CommandBehavior.SequentialAccesson its own: mapped reads (Map<T>(),AsObjectArrays(),AsDictionaryRows()),AnyAsync,CountAsync,LoadTableandLoadTablesdid, andToDataTableandToDataTableson anIDbCommandhad it as the default of theirbehaviorparameter, which is nowCommandBehavior.Default.New:
SequentialAccess(), one fluent opt-in.Mapterminals and theDataTableterminals. It stays on the command, and the caller's own flags stay.MappedCommand,MappedQueryand itsSkipandTakeforms) and the mapped definitions (MappedDbQuery).Use it for very large text or binary values, above all one value copied as a stream with
reader.GetStream. A selector given toMapmust then read the columns in ascending order, or the provider throws. WithAsyncReads()on a very large value, opt in: raw SqlClient withDefaultandReadAsynctook 48.0 s against 8.86 s for one 100 MB value; the library with default access was not measured.Docs: the XML docs and a compiled sample show the streaming case; the benchmark and async-read pages say which figures were measured with sequential access; release note.
🤖 Generated with Claude Code