pub struct Transaction { /* private fields */ }Expand description
An open transaction, holding its connection until it ends.
Implementations§
Source§impl Transaction
impl Transaction
Sourcepub fn dialect(&self) -> &dyn Dialect
pub fn dialect(&self) -> &dyn Dialect
The dialect this transaction speaks, so a query builder can render for
it. See the *_in methods on QueryBuilder.
pub async fn select(&mut self, sql: &str, params: &[Value]) -> Result<Vec<Row>>
pub async fn select_one( &mut self, sql: &str, params: &[Value], ) -> Result<Option<Row>>
pub async fn execute(&mut self, sql: &str, params: &[Value]) -> Result<u64>
pub async fn run(&mut self, sql: &str) -> Result<u64>
pub async fn scalar<T: FromValue>( &mut self, sql: &str, params: &[Value], ) -> Result<Option<T>>
Sourcepub async fn savepoint(&mut self, name: &str) -> Result<()>
pub async fn savepoint(&mut self, name: &str) -> Result<()>
A named savepoint, so part of a transaction can be undone on its own.
pub async fn rollback_to(&mut self, name: &str) -> Result<()>
Trait Implementations§
Source§impl Drop for Transaction
impl Drop for Transaction
Auto Trait Implementations§
impl !RefUnwindSafe for Transaction
impl !Sync for Transaction
impl !UnwindSafe for Transaction
impl Freeze for Transaction
impl Send for Transaction
impl Unpin for Transaction
impl UnsafeUnpin for Transaction
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