Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upUnable to do upsert with MySQL using diesel #1776
Comments
This comment has been minimized.
|
|
This comment has been minimized.
raintears
commented
Jul 6, 2018
|
Thanks for the clarification! So how then if we're using mysql, do an upsert? We should be able to do something like:
|
This comment has been minimized.
|
There are 2 possible ways here:
|
This comment has been minimized.
belsonheng
commented
Jul 9, 2018
|
I'm using replace_into but you can also use sql_query if you prefer. |
This comment has been minimized.
|
Note that |
sgrif
closed this
Jul 11, 2018
This comment has been minimized.
orangesoup
commented
Aug 19, 2018
|
I understand In my case I would like to batch insert or update thousands of rows every second, how can I do that with diesel? The guide only says it's not supported. Well... I would gladly use raw SQL, but even then I can't really see a way to provide it a huge An example query is something like this (simplified):
|
raintears commentedJul 6, 2018
I tried on_conflict but seems like it doesn't work for mysql? I'm getting no method named
on_conflictwhen compiling. Any reasons for that?