pub enum SqlxPool {
Postgres(PgPool),
}Expand description
A wrapper around SQLx connection pools supporting multiple databases.
Variants§
Implementations§
Source§impl SqlxPool
impl SqlxPool
Sourcepub async fn begin(&self) -> SqlxResult<SqlxTransaction<'_>>
pub async fn begin(&self) -> SqlxResult<SqlxTransaction<'_>>
Begin a transaction.
Source§impl SqlxPool
impl SqlxPool
Sourcepub async fn connect(config: &SqlxConfig) -> SqlxResult<Self>
pub async fn connect(config: &SqlxConfig) -> SqlxResult<Self>
Create a new pool from configuration.
Sourcepub fn backend(&self) -> DatabaseBackend
pub fn backend(&self) -> DatabaseBackend
Get the database backend type.
Sourcepub fn as_postgres(&self) -> Option<&PgPool>
pub fn as_postgres(&self) -> Option<&PgPool>
Get the underlying PostgreSQL pool.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SqlxPool
impl !RefUnwindSafe for SqlxPool
impl Send for SqlxPool
impl Sync for SqlxPool
impl Unpin for SqlxPool
impl !UnwindSafe for SqlxPool
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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