qp-postgres 0.1.1

Quick Pool: High Performance Async Generic Pool PostgreSQL Adapter
Documentation
1
2
3
4
5
6
7
8
9
10
11
use tokio_postgres::NoTls;

#[tokio::main]
async fn main() {
    let config = "postgresql://postgres:postgres@localhost".parse().unwrap();
    let pool = qp_postgres::connect(config, NoTls, 8);
    let client = pool.acquire().await.unwrap();
    let row = client.query_one("SELECT 1", &[]).await.unwrap();
    let int: i32 = row.get(0);
    dbg!(&int);
}