pub type PgPool = Pool<AsyncPgConnection>;
Expand description
Type alias for an async
pool of Postgres connections for async
diesel.
use rocket_db_pools::{Database, Connection};
use rocket_db_pools::diesel::{PgPool, prelude::*};
#[derive(Database)]
#[database("my_pg_db_name")]
struct Db(PgPool);
#[get("/")]
async fn use_db(mut db: Connection<Db>) {
/* .. */
}
Aliased Typeยง
struct PgPool { /* private fields */ }