8 stable releases

1.0.9 Sep 8, 2019
1.0.7 Sep 7, 2019
0.1.0 Sep 7, 2019

#170 in Database implementations

Download history 3/week @ 2023-11-03 12/week @ 2023-11-10 2/week @ 2023-11-17 10/week @ 2023-11-24 21/week @ 2023-12-01 14/week @ 2023-12-08 12/week @ 2023-12-15 19/week @ 2023-12-22 10/week @ 2024-01-05 18/week @ 2024-01-19 9/week @ 2024-01-26 11/week @ 2024-02-02 13/week @ 2024-02-09 106/week @ 2024-02-16

139 downloads per month

MIT license

8KB
85 lines

Rust TempDB - CockroachDB

Documentation Latest Version Build Status Coverage Status

Temporary CockroachDB databases for unit testing.

Installation

Add the following to your Cargo.toml:

[dev-dependencies]
tempdb_cockroach = ""

Install libpq-dev (required by the postgres crate):

sudo apt install libpq-dev

Install cockroach if you haven't already:

wget -qO- https://binaries.cockroachdb.com/cockroach-latest.linux-amd64.tgz | tar -xvz
sudo cp cockroach-*.linux-amd64/cockroach /usr/local/bin

Usage

extern crate tempdb_cockroach;

use tempdb_cockroach::TempCockroach;

#[test]
fn test() {
    let db = TempCockroach::new().expect("Failed to create DB");
    println!("Connection string: {}", db.url());

    // Cockroach process and data are cleaned up when db goes out of scope.
}

Dependencies

~7–17MB
~296K SLoC