Available on crate features
pool
and bb8
only.Expand description
A pool implementation for diesel-async
based on bb8
use diesel::result::Error;
use futures_util::FutureExt;
use diesel_async::pooled_connection::AsyncDieselConnectionManager;
use diesel_async::pooled_connection::bb8::Pool;
use diesel_async::{RunQueryDsl, AsyncConnection};
let config = AsyncDieselConnectionManager::<diesel_async::AsyncPgConnection>::new(db_url);
let pool: Pool<AsyncPgConnection> = Pool::builder().build(config).await?;
let mut conn = pool.get().await?;
let res = users.load::<(i32, String)>(&mut conn).await?;
Type Aliasesยง
- Type alias for using
bb8::Pool
with [diesel-async
] - Type alias for using
bb8::PooledConnection
with [diesel-async
] - Type alias for using
bb8::RunError
with [diesel-async
]