Enum rbatis_core::db::db_adapter::DBPool
source · [−]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
sourceimpl 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 !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