pgdb-rs

A small rust crate that allow easy creation and running of temporary Postgres databases, typically used for unit tests or similar things:

```rust let user = "dev"; let pw = "devpw"; let db = "dev";

// Run a postgres instance on port 15432. let pg = pgdb::Postgres::build() .start() .expect("could not build postgres database");

// We can now create a regular user and a database. pg.assuperuser() .createuser(user, pw) .expect("could not create normal user");

pg.assuperuser() .createdatabase(db, user) .expect("could not create normal user's db");

// Now we can run DDL commands, e.g. creating a table. let client = pg.asuser(user, pw); client .runsql(db, "CREATE TABLE foo (id INT PRIMARY KEY);") .expect("could not run table creation command"); ```

See the documentation for details.