Reputation: 60
I am migrating rust application from Postgres to Sqlite. But I've got an issue with upsert
Following code
diesel::insert_into(dialogs_table)
.values(dialog)
.on_conflict(user_id_column)
gives me this:
error[E0599]: no method named `on_conflict` found for struct InsertStatement in the current scope
I find this strange because it was working for Postgres. What could be the possible solution to use upsert here?
Upvotes: 0
Views: 1036
Reputation: 42492
What could be the possible solution to use upsert here?
Support for sqlite upserts was merged in early 2020 (after a very long and rather gruelling PR process), but it apparently includes breaking changes so my understanding's it'll only be available in Diesel 2.0.
Therefore your possibly solutions are:
don't use upserts
Upvotes: 3