Expand description
A connection pool implementation for diesel-async based on deadpool
use diesel::result::Error;
use futures_util::FutureExt;
use diesel_async::pooled_connection::AsyncDieselConnectionManager;
use diesel_async::pooled_connection::deadpool::Pool;
use diesel_async::{RunQueryDsl, AsyncConnection};
let config = AsyncDieselConnectionManager::<diesel_async::AsyncPgConnection>::new(db_url);
let pool: Pool<AsyncPgConnection> = Pool::builder(config).build()?;
let mut conn = pool.get().await?;
let res = users.load::<(i32, String)>(&mut conn).await?;Type Aliasesยง
- Build
Error - Type alias for using
deadpool::managed::BuildErrorwith [diesel-async] - Hook
- Type alias for using
deadpool::managed::Hookwith [diesel-async] - Hook
Error - Type alias for using
deadpool::managed::HookErrorwith [diesel-async] - Object
- Type alias for using
deadpool::managed::Objectwith [diesel-async] - Pool
- Type alias for using
deadpool::managed::Poolwith [diesel-async] - Pool
Builder - Type alias for using
deadpool::managed::PoolBuilderwith [diesel-async] - Pool
Error - Type alias for using
deadpool::managed::PoolErrorwith [diesel-async]