# <a href="https://cockroachlabs.com"><img src="https://raw.githubusercontent.com/calder/rust-tempdb/master/tempdb_cockroach/doc/logo.png" width="24" height="24"></a> Rust TempDB - [CockroachDB](https://www.cockroachlabs.com)
[](https://docs.rs/tempdb_cockroach) [](https://crates.io/crates/tempdb_cockroach)
Temporary [CockroachDB](https://www.cockroachlabs.com) databases for unit testing.
## Installation
Add the following to your `Cargo.toml`:
```toml
[dev-dependencies]
tempdb_cockroach = ""
```
[Install cockroach](https://www.cockroachlabs.com/docs/stable/install-cockroachdb.html) if you haven't already:
```sh
```
## 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.
}
```