Repository navigation
Add useAsyncEnumerable option for :many queries - #471
Merged
Merged
Conversation
…ble<Row> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018VvK2haj1hAvfXx9XWs7Rd
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018VvK2haj1hAvfXx9XWs7Rd
Dapper's QueryUnbufferedAsync has no CommandDefinition overload, so the Dapper streaming path passes sql/params directly and applies WithCancellation(token) to the enumeration. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018VvK2haj1hAvfXx9XWs7Rd
Contributor
Release Assistant - PassedAll requirements satisfied. Release Information:
This PR is ready to merge. |
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.
Summary
Adds an opt-in
useAsyncEnumerableoption (defaultfalse). When on,:manymethods returnIAsyncEnumerable<Row>and stream rows withyield returninstead of building aTask<List<Row>>. Output is unchanged when the option is off. Fixes #390.yield returnstraight from the reader, both transaction and no-transaction branches.QueryUnbufferedAsync. It has noCommandDefinitionoverload, so withwithCancellationTokenthe token is applied via.WithCancellation(token)and only cancels the enumeration, not the in-flight command. This is documented indocs/03_Usage.md.withCancellationToken, the token parameter is marked[EnumeratorCancellation]andSystem.Runtime.CompilerServicesis added to the usings.netstandard2.0is rejected (noIAsyncEnumerable).SqliteAsyncEnumerableExample(driver) andNpgsqlDapperAsyncEnumerableExample(Dapper), each with end-to-end tests covering streaming, empty results, transactions and cancellation.Verified locally
make unit-tests: 12 repository and 136 codegen tests passmake sqlc-generate: regenerated output committed and stable on a second rundotnet buildof the solution: 0 errorsmake dotnet-format: cleanNot run: the WASM plugin build and
sqlc diffagainst it, and the legacy (net472) tests, which are not affected.Checklist
make sqlc-generate) and committedmajor/minor/patchlabel is set (orskip-releasefor non-release changes) — I can't set labels here; suggestminorGenerated by Claude Code