I am trying to execute an insert or update using Diesel with PostgreSQL.
I have tried:
diesel::insert_into($table::table).values(&objects).on_conflict($table::id).do_update().set(&objects).execute(conn).unwrap();
where objects
is a std::vec::Vec<Struct>
- which results in the compiler error:
^^^ the trait 'diesel::query_builder::AsChangeset' is not implemented for '&std::vec::Vec<Struct>'
There is a on_conflict_do_nothing()
in the query builder but I can't seem to find something like on_conflict_do_update()
or on_conflict_do_replace()
.