Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add way to check if a RowCursor has more rows already available #69

Open
droundy opened this issue Jun 9, 2023 · 1 comment
Open

add way to check if a RowCursor has more rows already available #69

droundy opened this issue Jun 9, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@droundy
Copy link
Contributor

droundy commented Jun 9, 2023

I'd like to be able to batch up rows for further processing as a group. I know clickhouse returns its results in blocks, and it would be nice to be able to consume all the rows the blocks that have currently been received, and then pass them on to the next stage before waiting for more.

One way to achieve this would be to have a non-async

imp<...>l RowCursor<R> {
   /// Get the next row if it has already been buffered, otherwise return `None`.  If it hasn't been buffered (or an error happened), you'll have to call `next()`.
   fn next_if_ready(&mut self) -> <Option<T> { ... }
}
@loyd
Copy link
Collaborator

loyd commented Jul 4, 2023

The reason it's not implemented yet is because I think it's better to provide another API for batch processing to avoid overhead on .await point at all.

I mean, it's not too hard to provide try_next() -> Option<T> right now, but the more performant dedicated API requires more time to design.

@slvrtrn slvrtrn added the enhancement New feature or request label Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants