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>(conn: &mut Conn, sql: &str) -> QueryResult<()>where
Conn: Connection<TransactionManager = Self>,
pub fn begin_transaction_sql<Conn>(conn: &mut Conn, sql: &str) -> QueryResult<()>where
Conn: Connection<TransactionManager = Self>,
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 Debug for AnsiTransactionManager
impl Debug for AnsiTransactionManager
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 AnsiTransactionManagerwhere
Conn: Connection<TransactionManager = Self>,
impl<Conn> TransactionManager<Conn> for AnsiTransactionManagerwhere
Conn: Connection<TransactionManager = Self>,
sourcefn commit_transaction(conn: &mut Conn) -> QueryResult<()>
fn commit_transaction(conn: &mut Conn) -> QueryResult<()>
If the transaction fails to commit due to a SerializationFailure
or a
ReadOnlyTransaction
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 will be considered broken
as it contains a uncommitted unabortable open transaction.
type TransactionStateData = AnsiTransactionManager
type TransactionStateData = AnsiTransactionManager
Data stored as part of the connection implementation
to track the current transaction state of a connection Read more
sourcefn begin_transaction(conn: &mut Conn) -> QueryResult<()>
fn begin_transaction(conn: &mut Conn) -> QueryResult<()>
Begin a new transaction or savepoint Read more
sourcefn rollback_transaction(conn: &mut Conn) -> QueryResult<()>
fn rollback_transaction(conn: &mut Conn) -> QueryResult<()>
Rollback the inner-most transaction or savepoint 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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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
sourceimpl<T> IntoSql for T
impl<T> IntoSql for T
sourcefn into_sql<T>(self) -> AsExprOf<Self, T>where
Self: AsExpression<T> + Sized,
T: SqlType + TypedExpressionType,
fn into_sql<T>(self) -> AsExprOf<Self, T>where
Self: AsExpression<T> + Sized,
T: SqlType + TypedExpressionType,
Convert
self
to an expression for Diesel’s query builder. Read moresourcefn as_sql<'a, T>(&'a self) -> AsExprOf<&'a Self, T>where
&'a Self: AsExpression<T>,
T: SqlType + TypedExpressionType,
fn as_sql<'a, T>(&'a self) -> AsExprOf<&'a Self, T>where
&'a Self: AsExpression<T>,
T: SqlType + TypedExpressionType,
Convert
&self
to an expression for Diesel’s query builder. Read more