Struct diesel::connection::AnsiTransactionManager
source · [−]pub struct AnsiTransactionManager { /* private fields */ }
Expand description
An implementation of TransactionManager
which can be used for backends
which use ANSI standard syntax for savepoints such as SQLite and PostgreSQL.
Implementations
sourceimpl AnsiTransactionManager
impl AnsiTransactionManager
sourcepub fn begin_transaction_sql<Conn>(
&self,
conn: &Conn,
sql: &str
) -> QueryResult<()> where
Conn: SimpleConnection,
pub fn begin_transaction_sql<Conn>(
&self,
conn: &Conn,
sql: &str
) -> QueryResult<()> where
Conn: SimpleConnection,
Begin a transaction with custom SQL
This is used by connections to implement more complex transaction APIs to set things such as isolation levels. Returns an error if already inside of a transaction.
Trait Implementations
sourceimpl Default for AnsiTransactionManager
impl Default for AnsiTransactionManager
sourcefn default() -> AnsiTransactionManager
fn default() -> AnsiTransactionManager
Returns the “default value” for a type. Read more
sourceimpl<Conn> TransactionManager<Conn> for AnsiTransactionManager where
Conn: Connection,
Conn::Backend: UsesAnsiSavepointSyntax,
impl<Conn> TransactionManager<Conn> for AnsiTransactionManager where
Conn: Connection,
Conn::Backend: UsesAnsiSavepointSyntax,
sourcefn commit_transaction(&self, conn: &Conn) -> QueryResult<()>
fn commit_transaction(&self, conn: &Conn) -> QueryResult<()>
If the transaction fails to commit due to a SerializationFailure
, a rollback will be attempted.
If the rollback succeeds, the original error will be returned, otherwise the error generated by
the rollback will be returned. In the second case the connection should be considered broken
as it contains a uncommitted unabortable open transaction.
sourcefn begin_transaction(&self, conn: &Conn) -> QueryResult<()>
fn begin_transaction(&self, conn: &Conn) -> QueryResult<()>
Begin a new transaction or savepoint Read more
sourcefn rollback_transaction(&self, conn: &Conn) -> QueryResult<()>
fn rollback_transaction(&self, conn: &Conn) -> QueryResult<()>
Rollback the inner-most transaction or savepoint Read more
sourcefn get_transaction_depth(&self) -> u32
fn get_transaction_depth(&self) -> u32
Fetch the current transaction depth Read more
Auto Trait Implementations
impl !RefUnwindSafe for AnsiTransactionManager
impl Send for AnsiTransactionManager
impl !Sync for AnsiTransactionManager
impl Unpin for AnsiTransactionManager
impl UnwindSafe for AnsiTransactionManager
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more