pub struct PostgresConnection { /* private fields */ }Expand description
PostgreSQL connection implementation
Implementations§
Source§impl PostgresConnection
impl PostgresConnection
pub fn new(conn: PoolConnection<Postgres>) -> Self
Trait Implementations§
Source§impl DatabaseConnection for PostgresConnection
impl DatabaseConnection for PostgresConnection
Source§fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut 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 mut 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 and return affected rows count
Source§fn fetch_all<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut 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 mut 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 the result rows
Source§fn fetch_optional<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut 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 mut 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
Source§fn begin_transaction<'life0, 'async_trait>(
&'life0 mut 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 mut self,
) -> Pin<Box<dyn Future<Output = OrmResult<Box<dyn DatabaseTransaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Begin a transaction
Auto Trait Implementations§
impl Freeze for PostgresConnection
impl !RefUnwindSafe for PostgresConnection
impl Send for PostgresConnection
impl Sync for PostgresConnection
impl Unpin for PostgresConnection
impl !UnwindSafe for PostgresConnection
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