pub struct PooledPgClient { /* private fields */ }Expand description
A wrapper around deadpool_postgres::Object implementing the NextSQL Client trait.
This allows using a pooled connection from deadpool-postgres directly with NextSQL generated query/mutation functions.
Implementations§
Trait Implementations§
Source§impl Client for PooledPgClient
impl Client for PooledPgClient
type Error = Error
type Row = PgRow
type Transaction<'a> = PgTransaction<'a>
Source§fn query(
&self,
sql: &str,
params: &[&dyn ToSqlParam],
) -> impl Future<Output = Result<Vec<Self::Row>, Self::Error>> + Send
fn query( &self, sql: &str, params: &[&dyn ToSqlParam], ) -> impl Future<Output = Result<Vec<Self::Row>, Self::Error>> + Send
Execute a query that returns rows.
Source§fn execute(
&self,
sql: &str,
params: &[&dyn ToSqlParam],
) -> impl Future<Output = Result<u64, Self::Error>> + Send
fn execute( &self, sql: &str, params: &[&dyn ToSqlParam], ) -> impl Future<Output = Result<u64, Self::Error>> + Send
Execute a statement that returns the number of affected rows.
Source§fn transaction(
&mut self,
) -> impl Future<Output = Result<Self::Transaction<'_>, Self::Error>> + Send
fn transaction( &mut self, ) -> impl Future<Output = Result<Self::Transaction<'_>, Self::Error>> + Send
Begin a new transaction.
Auto Trait Implementations§
impl Freeze for PooledPgClient
impl !RefUnwindSafe for PooledPgClient
impl Send for PooledPgClient
impl Sync for PooledPgClient
impl Unpin for PooledPgClient
impl UnsafeUnpin for PooledPgClient
impl !UnwindSafe for PooledPgClient
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