Module diesel_async::pooled_connection::deadpool
source · Expand description
A connection pool implementation for diesel-async
based on deadpool
use diesel::result::Error;
use futures::FutureExt;
use diesel_async::pooled_connection::AsyncDieselConnectionManager;
use diesel_async::pooled_connection::deadpool::Pool;
use diesel_async::RunQueryDsl;
let config = AsyncDieselConnectionManager::<diesel_async::AsyncPgConnection>::new(db_url);
let pool = Pool::builder(config).build()?;
let mut conn = pool.get().await?;
let res = users.load::<(i32, String)>(&mut conn).await?;
Type Aliases§
- Type alias for using
deadpool::managed::BuildError
with [diesel-async
] - Type alias for using
deadpool::managed::Hook
with [diesel-async
] - Type alias for using
deadpool::managed::HookError
with [diesel-async
] - Type alias for using
deadpool::managed::HookErrorCause
with [diesel-async
] - Type alias for using
deadpool::managed::Object
with [diesel-async
] - Type alias for using
deadpool::managed::Pool
with [diesel-async
] - Type alias for using
deadpool::managed::PoolBuilder
with [diesel-async
] - Type alias for using
deadpool::managed::PoolError
with [diesel-async
]