Struct sqlx::Transaction[][src]

pub struct Transaction<'c, DB> where
    DB: Database
{ /* fields omitted */ }

An in-progress database transaction or savepoint.

A transaction starts with a call to Pool::begin or Connection::begin.

A transaction should end with a call to commit or rollback. If neither are called before the transaction goes out-of-scope, rollback is called. In other words, rollback is called on drop if the transaction is still in-progress.

A savepoint is a special mark inside a transaction that allows all commands that are executed after it was established to be rolled back, restoring the transaction state to what it was at the time of the savepoint.

Implementations

impl<'c, DB> Transaction<'c, DB> where
    DB: Database
[src]

pub async fn commit(self) -> Result<(), Error>[src]

Commits this transaction or savepoint.

pub async fn rollback(self) -> Result<(), Error>[src]

Aborts this transaction or savepoint.

Trait Implementations

impl<'c, 't> Acquire<'t> for &'t mut Transaction<'c, Any>[src]

type Database = Any

type Connection = &'t mut <Any as Database>::Connection

impl<'c, 't> Acquire<'t> for &'t mut Transaction<'c, Postgres>[src]

type Database = Postgres

type Connection = &'t mut <Postgres as Database>::Connection

impl<'c, 't> Acquire<'t> for &'t mut Transaction<'c, MySql>[src]

type Database = MySql

type Connection = &'t mut <MySql as Database>::Connection

impl<'c, 't> Acquire<'t> for &'t mut Transaction<'c, Sqlite>[src]

type Database = Sqlite

type Connection = &'t mut <Sqlite as Database>::Connection

impl<'c, 't> Acquire<'t> for &'t mut Transaction<'c, Mssql>[src]

type Database = Mssql

type Connection = &'t mut <Mssql as Database>::Connection

impl<'c, DB> Debug for Transaction<'c, DB> where
    DB: Database
[src]

impl<'c, DB> Deref for Transaction<'c, DB> where
    DB: Database
[src]

type Target = <DB as Database>::Connection

The resulting type after dereferencing.

impl<'c, DB> DerefMut for Transaction<'c, DB> where
    DB: Database
[src]

impl<'c, DB> Drop for Transaction<'c, DB> where
    DB: Database
[src]

impl<'c, 't> Executor<'t> for &'t mut Transaction<'c, Sqlite>[src]

type Database = Sqlite

impl<'c, 't> Executor<'t> for &'t mut Transaction<'c, Any>[src]

type Database = Any

impl<'c, 't> Executor<'t> for &'t mut Transaction<'c, MySql>[src]

type Database = MySql

impl<'c, 't> Executor<'t> for &'t mut Transaction<'c, Postgres>[src]

type Database = Postgres

impl<'c, 't> Executor<'t> for &'t mut Transaction<'c, Mssql>[src]

type Database = Mssql

Auto Trait Implementations

impl<'c, DB> !RefUnwindSafe for Transaction<'c, DB>[src]

impl<'c, DB> Send for Transaction<'c, DB>[src]

impl<'c, DB> Sync for Transaction<'c, DB> where
    <DB as Database>::Connection: Sync
[src]

impl<'c, DB> Unpin for Transaction<'c, DB> where
    <DB as Database>::Connection: Unpin
[src]

impl<'c, DB> !UnwindSafe for Transaction<'c, DB>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,