-
Notifications
You must be signed in to change notification settings - Fork 98
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
Implement Stream
for RowCursor
#122
Comments
Makes sense, possibly under dedicated |
I've had an initial attempt at implementing stream using https://github.com/tokio-rs/async-stream. However, during testing against a non-toy database I found cases where the deserialized strings are invalid utf8 which points to some buffer corruption somewhere. Not entirely sure where to start debugging that as it does not happen when you use the cursor directly manually. this is the current branch in case that's helpful: https://github.com/v3xro/clickhouse.rs/tree/feat/impl-stream Edit 1: I found tokio-rs/async-stream#106 so will re-check, seems quite likely |
@loyd do you have an idea how to fix #24? The sqlx type signature linked in the ticket did not inspire me to a solution 😁 Looking at the code, it looks like you would need to move the lifetime of the buffer into the cursor type so you can properly have the serde Edit: did more research, found #46 and now wondering whether it would even be possible to provide a generic Stream API without implementing the copy variant of serde deserializers |
#24 affects your case only if you want to use borrowed rows in So, you should add such restrictions on v3xro@d25b1bb#diff-f0c63cae3ed0328ebbe14ac22d86b43bc8a40146944b03c8326681e4f3802443R200 as |
And I'm sure we should avoid
It seems it can be easily replaced with unfold here. |
This would make usage within other async code more ergonomic.
The text was updated successfully, but these errors were encountered: