-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Streaming queries? #1775
Comments
It is currently not possible. Maybe a later version of diesel may add support for this feature. |
Has something changed in this area? |
As I'm new to both Rust and SQL, are there any patterns to efficiently iterate over large SQL tables to post process or update rows in diesel? I'm thinking streaming queries would serve this purpose, but haven't used databases enough to know what are all the kind of design patterns that exist for this task. Before diesel, I was using query_map in rusqlite, though I think it still loads the entire vec into memory.
@weiznich, could you please link to any open tickets or Rust design PRs so I can read more on this? |
Iterating again over the whole result set is much cheaper than loading data from the database, so adding a specific functionality to map results there is meaningless in my opinion. That said for update statements it is not required to load data from the database, modify it and write it back, you could those queries fully on sql side. Basically something like Streaming queries are blocked on a async interface. So basically #1399 |
Hmm, I could see how the async interface could improve things, but I don't understand the relation to the ticket for changing
I was more concerned with RAM memory than disk latency, as I my use case may encounter |
Yes I've mistyped the number, should be #399.
If you are using Sqlite it is even simpler than I've suggested above. You can just register a random rust function as |
Thanks @weiznich ! I don't want to derail this issue, so I'll continue iterating over at dledr/bbr_ros2#9 |
Is there a way to process rows as they're received, ie a way to get an iterator for a query rather than a vector? Or is this technically impossible due to how the lowlevel works? Thanks.
The text was updated successfully, but these errors were encountered: