pub enum DBPool {
None,
Mysql(MySqlPool, Arc<Box<dyn DataDecoder>>),
Postgres(PgPool, Arc<Box<dyn DataDecoder>>),
Sqlite(SqlitePool, Arc<Box<dyn DataDecoder>>),
Mssql(MssqlPool, Arc<Box<dyn DataDecoder>>),
}Variants§
None
Mysql(MySqlPool, Arc<Box<dyn DataDecoder>>)
Postgres(PgPool, Arc<Box<dyn DataDecoder>>)
Sqlite(SqlitePool, Arc<Box<dyn DataDecoder>>)
Mssql(MssqlPool, Arc<Box<dyn DataDecoder>>)
Implementations§
Source§impl DBPool
impl DBPool
pub fn driver_type(&self) -> DriverType
pub async fn new(driver: &str) -> Result<DBPool>
pub async fn new_opt_str(driver: &str, opt: DBPoolOptions) -> Result<DBPool>
pub async fn new_opt( driver: &DBConnectOption, opt: DBPoolOptions, ) -> Result<DBPool>
pub fn make_query<'f, 's>(&'f self, sql: &'s str) -> Result<DBQuery<'s>>
Sourcepub async fn acquire(&self) -> Result<DBPoolConn<'_>>
pub async fn acquire(&self) -> Result<DBPoolConn<'_>>
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<'_>>>
pub fn try_acquire(&self) -> Result<Option<DBPoolConn<'_>>>
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<'_>>
pub async fn close(&self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DBPool
impl !RefUnwindSafe for DBPool
impl Send for DBPool
impl Sync for DBPool
impl Unpin for DBPool
impl !UnwindSafe for DBPool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more