pub struct PostgresClientWrapper { /* private fields */ }
Expand description
Wrapper for PostgreSQL client to handle connection
Implementations§
Source§impl PostgresClientWrapper
impl PostgresClientWrapper
Sourcepub fn execute(
&self,
query: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<u64, PostgresError>
pub fn execute( &self, query: &str, params: &[&(dyn ToSql + Sync)], ) -> Result<u64, PostgresError>
Execute a query on the PostgreSQL connection
Sourcepub fn query(
&self,
query: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<Vec<Row>, PostgresError>
pub fn query( &self, query: &str, params: &[&(dyn ToSql + Sync)], ) -> Result<Vec<Row>, PostgresError>
Execute a query on the PostgreSQL connection and return the rows
Sourcepub fn query_one(
&self,
query: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<Row, PostgresError>
pub fn query_one( &self, query: &str, params: &[&(dyn ToSql + Sync)], ) -> Result<Row, PostgresError>
Execute a query on the PostgreSQL connection and return a single row
Sourcepub fn query_opt(
&self,
query: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<Option<Row>, PostgresError>
pub fn query_opt( &self, query: &str, params: &[&(dyn ToSql + Sync)], ) -> Result<Option<Row>, PostgresError>
Execute a query on the PostgreSQL connection and return an optional row
Sourcepub fn ping(&self) -> Result<bool, PostgresError>
pub fn ping(&self) -> Result<bool, PostgresError>
Ping the PostgreSQL server to check if the connection is alive
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