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§
source§impl 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§
source§impl Debug for AnsiTransactionManager
impl Debug for AnsiTransactionManager
source§impl Default for AnsiTransactionManager
impl Default for AnsiTransactionManager
source§fn default() -> AnsiTransactionManager
fn default() -> AnsiTransactionManager
Returns the “default value” for a type. Read more
source§impl<Conn> TransactionManager<Conn> for AnsiTransactionManagerwhere
Conn: Connection<TransactionManager = Self>,
impl<Conn> TransactionManager<Conn> for AnsiTransactionManagerwhere Conn: Connection<TransactionManager = Self>,
source§fn 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
source§fn begin_transaction(conn: &mut Conn) -> QueryResult<()>
fn begin_transaction(conn: &mut Conn) -> QueryResult<()>
Begin a new transaction or savepoint Read more
source§fn rollback_transaction(conn: &mut Conn) -> QueryResult<()>
fn rollback_transaction(conn: &mut Conn) -> QueryResult<()>
Rollback the inner-most transaction or savepoint Read more
source§fn transaction_manager_status_mut(
conn: &mut Conn
) -> &mut TransactionManagerStatus
fn transaction_manager_status_mut( conn: &mut Conn ) -> &mut TransactionManagerStatus
Available on crate feature
i-implement-a-third-party-backend-and-opt-into-breaking-changes
only.Fetch the current transaction status as mutable 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§
source§impl<T> IntoSql for T
impl<T> IntoSql for T
source§fn 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 moresource§fn 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