pub struct PostgresPool { /* private fields */ }Expand description
PostgreSQL connection pool implementation
Implementations§
Trait Implementations§
Source§impl DatabasePool for PostgresPool
impl DatabasePool for PostgresPool
Source§fn acquire<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = OrmResult<Box<dyn DatabaseConnection>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn acquire<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = OrmResult<Box<dyn DatabaseConnection>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Acquire a connection from the pool
Source§fn begin_transaction<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = OrmResult<Box<dyn DatabaseTransaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn begin_transaction<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = OrmResult<Box<dyn DatabaseTransaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Begin a transaction from the pool
Source§fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
sql: &'life1 str,
params: &'life2 [DatabaseValue],
) -> Pin<Box<dyn Future<Output = OrmResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
sql: &'life1 str,
params: &'life2 [DatabaseValue],
) -> Pin<Box<dyn Future<Output = OrmResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Execute a query directly on the pool
Source§fn fetch_all<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
sql: &'life1 str,
params: &'life2 [DatabaseValue],
) -> Pin<Box<dyn Future<Output = OrmResult<Vec<Box<dyn DatabaseRow>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn fetch_all<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
sql: &'life1 str,
params: &'life2 [DatabaseValue],
) -> Pin<Box<dyn Future<Output = OrmResult<Vec<Box<dyn DatabaseRow>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Execute a query and return result rows directly on the pool
Source§fn fetch_optional<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
sql: &'life1 str,
params: &'life2 [DatabaseValue],
) -> Pin<Box<dyn Future<Output = OrmResult<Option<Box<dyn DatabaseRow>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn fetch_optional<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
sql: &'life1 str,
params: &'life2 [DatabaseValue],
) -> Pin<Box<dyn Future<Output = OrmResult<Option<Box<dyn DatabaseRow>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Execute a query and return the first result row directly on the pool
Source§fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = OrmResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = OrmResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Close the pool
Source§fn stats(&self) -> DatabasePoolStats
fn stats(&self) -> DatabasePoolStats
Get pool statistics
Auto Trait Implementations§
impl Freeze for PostgresPool
impl !RefUnwindSafe for PostgresPool
impl Send for PostgresPool
impl Sync for PostgresPool
impl Unpin for PostgresPool
impl !UnwindSafe for PostgresPool
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> 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