pub enum DBPool {
None,
Mysql(Pool<MySql>, Arc<Box<dyn DataDecoder + 'static, Global>>),
Postgres(Pool<Postgres>, Arc<Box<dyn DataDecoder + 'static, Global>>),
Sqlite(Pool<Sqlite>, Arc<Box<dyn DataDecoder + 'static, Global>>),
Mssql(Pool<Mssql>, Arc<Box<dyn DataDecoder + 'static, Global>>),
}
Variants
None
Mysql(Pool<MySql>, Arc<Box<dyn DataDecoder + 'static, Global>>)
Postgres(Pool<Postgres>, Arc<Box<dyn DataDecoder + 'static, Global>>)
Sqlite(Pool<Sqlite>, Arc<Box<dyn DataDecoder + 'static, Global>>)
Mssql(Pool<Mssql>, Arc<Box<dyn DataDecoder + 'static, Global>>)
Implementations
sourceimpl DBPool
impl DBPool
pub fn driver_type(&self) -> DriverType
pub async fn new(driver: &'_ str) -> Result<DBPool, Error>
pub async fn new_opt_str(
driver: &'_ str,
opt: DBPoolOptions
) -> Result<DBPool, Error>
pub async fn new_opt(
driver: &'_ DBConnectOption,
opt: DBPoolOptions
) -> Result<DBPool, Error>
pub fn make_query(&'f self, sql: &'s str) -> Result<DBQuery<'s>, Error>
sourcepub async fn acquire(&'_ self) -> Result<DBPoolConn<'_>, Error>
pub async fn acquire(&'_ self) -> Result<DBPoolConn<'_>, Error>
Retrieves a connection from the pool.
Waits for at most the configured connection timeout before returning an error.
sourcepub fn try_acquire(&self) -> Result<Option<DBPoolConn<'_>>, Error>
pub fn try_acquire(&self) -> Result<Option<DBPoolConn<'_>>, Error>
Attempts to retrieve a connection from the pool if there is one available.
Returns None
immediately if there are no idle connections available in the pool.
pub async fn begin(&'_ self) -> Result<DBTx<'_>, Error>
pub async fn close(&'_ self)
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for DBPool
impl Send for DBPool
impl Sync for DBPool
impl Unpin for DBPool
impl !UnwindSafe for DBPool
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more