Statement Aggregator #2152
Closed
anshap1719
started this conversation in
Ideas
Replies: 1 comment
-
I had to write something similar for a project anyway, so at this point, I'll close this discussion and create the PR directly so that a discussion can happen in context of the implementation. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The title probably doesn't describe much 😅
We're using sea-orm in a project that heavily involves cron jobs that run data processing pipelines in our system to convert them from source to the format we have. One important part of this is to not have to run a million DB statements as separate calls, for example.
This is already optimizable for selects and inserts (using insert_many, for example). But we also do a lot of updates. And these updates involve updating individual rows with different parameters and each row is applied different updates, so the current
update_many
implementation is not something that's helpful here.We presently have an internal implementation of
update_many_from_active_models
that basically works likeinsert_many
by taking an iterator of active models and creates a single SQL query at the end for all of the update statements. Each update is still performed as an individual operation, but the SQL itself is sent to the DB only once. So I have two ideas that kinda overlap each other:update_many
implementation I described above into the sea-orm project.I'd be happy to create a PR for either of these, specially since I've done quite a bit of work on this on my project already.
Beta Was this translation helpful? Give feedback.
All reactions