Available on (crate features deadpool or bb8 or mobc or r2d2) and crate feature mobc only.
Expand description

A pool implementation for diesel-async based on mobc

use diesel::result::Error;
use futures_util::FutureExt;
use diesel_async::pooled_connection::AsyncDieselConnectionManager;
use diesel_async::pooled_connection::mobc::Pool;
use diesel_async::{RunQueryDsl, AsyncConnection};

let config = AsyncDieselConnectionManager::<diesel_async::AsyncPgConnection>::new(db_url);
let pool = Pool::new(config);
let mut conn = pool.get().await?;
let res = users.load::<(i32, String)>(&mut conn).await?;

Type Aliases