Repository navigation
rc.4: Map<T>() on a reader or a raw command (MappedReader<T>, MappedCommand<T>) - #117
Merged
Merged
Conversation
…async terminals that take the type Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…s of a command and their binding Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…g one column Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ne, => on its own line, doc comments wrapped at natural breaks Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…d (IDE0011) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ader or command A null map, an empty pair list and a default struct behave as documented. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…eir own types Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… two view tests Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…en gives a cancelled task, document Read() and the CS0121 ambiguity Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Map<T>()on a reader or a raw command, for 11.0.0-rc.4 (API shape). #111 is merged and master is merged in.What
reader.Map<T>()returnsMappedReader<T>, andcommand.Map<T>()returnsMappedCommand<T>.readonly record structs that implementIMappedQuery<T>, with exactly the membersMappedQuery<T>has: every terminal in its sync and async form (ValueTask, token last),Read/ReadAsync, andSkip/Take, which return the existingMappedQueryWithSkip<T>/MappedQueryWithTake<T>. Nothing new.SingleResult()is onMappedCommand<T>only.Map<T>overloads each onIDataReaderandIDbCommand, mirroring theIExecuteReaderones (same parameter lists,OverloadResolutionPriorityvalues and guards).Ownership
NextResult. On a reader view,SingleResult()reached throughSkip/Takeis a no-op.MappedQuery<T>. It opens the connection only if it is closed and closes (not disposes) only what it opened; it reads through the later result sets to surface late failures unlessSingleResult()was called; async terminals open and execute asynchronously on aDbCommand.Behavior changes in this PR
RowMap<T>passed toMap<T>(map)now maps by default, exactly likeMap<T>(), at all three levels. It used to throwArgumentNullExceptiononIExecuteReader. Noted in whats-new-11.md.defaultstruct of the whole family (MappedQuery<T>, the two staging structs and the two views) now throwsInvalidOperationExceptionsaying it was not created byMap<T>(), instead of aNullReferenceException.IExecuteReaderandIDbCommand(orIDataReader) gets an ambiguousMapcall (CS0121); cast to pick a level.Docs
Map<T>remarks now say how columns match by default: exactly, then ignoring case, then ignoring case and underscores (author_idfeedsAuthorId), with the resolved layout cached per result-set layout.Checks
Since the review
ToArrayAsync<int>(ct)), andMap<int>()reads the first column #111 squashed, rc.4: RetrieveAsync takes a CancellationToken; misnamed parameters renamed #116) is merged in; the diff against master is the views only.ConfigureAwait(false), and the reader view returns a cancelled task for a cancelled token instead of throwing at the call.Read(), as an expressive command does by default; whats-new notes the CS0121 ambiguity.MappedQuery<T>for every terminal (sync and async), a counting substitute reader proving the reader view never callsNextResult,CloseorDispose, command-view ownership with open and closed connections, null and empty maps at all three levels,defaultstructs, and compile-only binding.🤖 Generated with Claude Code