pub struct PostgresClientWrapper { /* private fields */ }Expand description
A wrapper around tokio_postgres::Client, which provides a more convenient interface for working with the client.
Implementations§
Source§impl PostgresClientWrapper
impl PostgresClientWrapper
Sourcepub async fn new(connection_string: &str) -> Result<Self>
pub async fn new(connection_string: &str) -> Result<Self>
Create a new PostgresClientWrapper.
This will connect to the postgres server to figure out the version of the server. If the version is less than 12, an error is returned.
Sourcepub async fn create_another_connection(&self) -> Result<Self>
pub async fn create_another_connection(&self) -> Result<Self>
Create another connection to the same server
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PostgresClientWrapper
impl !RefUnwindSafe for PostgresClientWrapper
impl Send for PostgresClientWrapper
impl Sync for PostgresClientWrapper
impl Unpin for PostgresClientWrapper
impl !UnwindSafe for PostgresClientWrapper
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