Additional Diesel ORM support for CockroachDB syntax.
cargo install diesel_cockroach
Currently supported features are listed below:
See the official insert_into
documentation for general examples.
Just replace the diesel::insert_into
function with the disired function from diesel_cockroach
:
use diesel_cockroach::upsert::upsert_into;
let new_users = vec![
name.eq("Tess"),
name.eq("Jim"),
];
let rows_upserted = upsert_into(users)
.values(&new_users)
.execute(&connection);
assert_eq!(Ok(2), rows_upserted);