mirror of
https://github.com/dani-garcia/vaultwarden.wiki.git
synced 2026-10-23 06:38:10 +03:00
Use insert_into when possible (#6437)
Co-authored-by: Timshel <timshel@users.noreply.github.com>
This commit is contained in:
1 parent
e992cbb4f5
commit
25dfedafd7
14 files changed
+188
-333
No files matched your search
@@ -146,15 +146,18 @@ impl Device {
|
||||
}
|
||||
|
||||
db_run! { conn:
|
||||
sqlite, mysql {
|
||||
mysql {
|
||||
crate::util::retry(||
|
||||
diesel::replace_into(devices::table)
|
||||
diesel::insert_into(devices::table)
|
||||
.values(&*self)
|
||||
.on_conflict(diesel::dsl::DuplicatedKeys)
|
||||
.do_update()
|
||||
.set(&*self)
|
||||
.execute(conn),
|
||||
10,
|
||||
).map_res("Error saving device")
|
||||
}
|
||||
postgresql {
|
||||
postgresql, sqlite {
|
||||
crate::util::retry(||
|
||||
diesel::insert_into(devices::table)
|
||||
.values(&*self)
|
||||
|
||||
Reference in new issue
Block a user