Skip to content

Comments

Add user buffer for QueryAsync#2194

Open
Dimoner wants to merge 2 commits intoDapperLib:mainfrom
Dimoner:add-user-buffer
Open

Add user buffer for QueryAsync#2194
Dimoner wants to merge 2 commits intoDapperLib:mainfrom
Dimoner:add-user-buffer

Conversation

@Dimoner
Copy link

@Dimoner Dimoner commented Feb 24, 2026

I suggest adding the ability to pass a custom buffer from user code. This would make it possible, in flows where we sequentially iterate over a large table and process records in chunks, to avoid reallocating the buffer. In my case, I need to traverse 5 million rows in batches of 100k when retrieving them from the database. I want to do this using a single array instead of allocating a new one each time.

Why is this not equivalent to a buffering flag?
Because the method returns IEnumerable rather than IAsyncEnumerable. As a result, the non-buffered mode relies on synchronous overloads. We should either change the design accordingly or provide an IAsyncEnumerable counterpart for the method without the buffering flag.

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