pub struct PgTx<'a> { /* private fields */ }
Implementations§
Source§impl PgTx<'_>
impl PgTx<'_>
Sourcepub async fn batch_execute(&mut self, sql: &str) -> Result<(), C3p0Error>
pub async fn batch_execute(&mut self, sql: &str) -> Result<(), C3p0Error>
Executes a batch of SQL statements
Sourcepub async fn execute(
&mut self,
sql: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<u64, C3p0Error>
pub async fn execute( &mut self, sql: &str, params: &[&(dyn ToSql + Sync)], ) -> Result<u64, C3p0Error>
Executes a SQL statement
Sourcepub async fn fetch_one_value<T: FromSqlOwned>(
&mut self,
sql: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<T, C3p0Error>
pub async fn fetch_one_value<T: FromSqlOwned>( &mut self, sql: &str, params: &[&(dyn ToSql + Sync)], ) -> Result<T, C3p0Error>
Fetches a single value with a custom sql query and parameters
Sourcepub async fn fetch_one<T, F: Fn(&Row) -> Result<T, Box<dyn Error>>>(
&mut self,
sql: &str,
params: &[&(dyn ToSql + Sync)],
mapper: F,
) -> Result<T, C3p0Error>
pub async fn fetch_one<T, F: Fn(&Row) -> Result<T, Box<dyn Error>>>( &mut self, sql: &str, params: &[&(dyn ToSql + Sync)], mapper: F, ) -> Result<T, C3p0Error>
Fetches a single row with a custom sql query and parameters
Sourcepub async fn fetch_one_optional<T, F: Fn(&Row) -> Result<T, Box<dyn Error>>>(
&mut self,
sql: &str,
params: &[&(dyn ToSql + Sync)],
mapper: F,
) -> Result<Option<T>, C3p0Error>
pub async fn fetch_one_optional<T, F: Fn(&Row) -> Result<T, Box<dyn Error>>>( &mut self, sql: &str, params: &[&(dyn ToSql + Sync)], mapper: F, ) -> Result<Option<T>, C3p0Error>
Fetches a single row with a custom sql query and parameters
Sourcepub async fn fetch_all<T, F: Fn(&Row) -> Result<T, Box<dyn Error>>>(
&mut self,
sql: &str,
params: &[&(dyn ToSql + Sync)],
mapper: F,
) -> Result<Vec<T>, C3p0Error>
pub async fn fetch_all<T, F: Fn(&Row) -> Result<T, Box<dyn Error>>>( &mut self, sql: &str, params: &[&(dyn ToSql + Sync)], mapper: F, ) -> Result<Vec<T>, C3p0Error>
Fetches multiple rows with a custom sql query and parameters
Sourcepub async fn fetch_all_values<T: FromSqlOwned>(
&mut self,
sql: &str,
params: &[&(dyn ToSql + Sync)],
) -> Result<Vec<T>, C3p0Error>
pub async fn fetch_all_values<T: FromSqlOwned>( &mut self, sql: &str, params: &[&(dyn ToSql + Sync)], ) -> Result<Vec<T>, C3p0Error>
Fetches multiple values with a custom sql query and parameters
Auto Trait Implementations§
impl<'a> Freeze for PgTx<'a>
impl<'a> !RefUnwindSafe for PgTx<'a>
impl<'a> Send for PgTx<'a>
impl<'a> Sync for PgTx<'a>
impl<'a> Unpin for PgTx<'a>
impl<'a> !UnwindSafe for PgTx<'a>
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