Rust TempDB - CockroachDB

Documentation Latest Version

Temporary CockroachDB databases for unit testing.

Installation

Add the following to your Cargo.toml: toml [dev-dependencies] tempdb_cockroach = ""

Install cockroach if you haven't already: sh wget -qO- https://binaries.cockroachdb.com/cockroach-v19.1.4.linux-amd64.tgz | tar -xvz cp -i cockroach-v19.1.4.linux-amd64/cockroach /usr/local/bin

Usage

```rust 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.

} ```