#diesel #syntax #orm #documentation #cockroach-db #upsert

diesel_cockroach

Additional Diesel ORM support for CockroachDB syntax

2 releases

0.1.1 Nov 12, 2020
0.1.0 Oct 22, 2020

#2429 in Database interfaces

26 downloads per month

MIT license

8KB
119 lines

diesel_cockroach

Crates.io CircleCI branch GitHub

Additional Diesel ORM support for CockroachDB syntax.

Installation

cargo install diesel_cockroach

Feature Support

Currently supported features are listed below:

Usage

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);

Dependencies

~4MB
~82K SLoC