mockgres 0.0.29

An in-memory database that replicates a reasonable subset of Postgres functionality to make unit tests that rely on a database to run.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
mod common;

#[tokio::test(flavor = "multi_thread")]
async fn create_unique_index_parses() {
    let ctx = common::start().await;
    ctx.client
        .batch_execute("create table u(i int primary key, v int)")
        .await
        .unwrap();
    ctx.client
        .batch_execute("create unique index ux on u(v)")
        .await
        .unwrap();
    let _ = ctx.shutdown.send(());
}