How to update multiple entries in a single network communication? #2832
Unanswered
Charlestar
asked this question in
Q&A
Replies: 1 comment
-
|
if your (id, app_name) has a unique key (which you should for this use case), you can do on conflict update. status::Entity::insert(item)
.on_conflict(
OnConflict::columns([status::Column::Id, status::Column::AppName])
.update_column(status::Column::Status)
.to_owned()
)it results in something like |
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
Uh oh!
There was an error while loading. Please reload this page.
-
I want to transmit a queue of triples
[(status, app_name, id), updating the status of entries whereapp_nameandidmatch to the currentstatus. I want to send a batch of requests to the database server in a single network communication to speed up execution. I feel that the existing update_many method cannot meet my needs because it requires putting the update request into a single SQL statement, which seems difficult to implement. Can you give me some suggestions on how to speed things up?Beta Was this translation helpful? Give feedback.
All reactions