diesel::connection

Struct 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

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AnsiTransactionManager

Source§

fn default() -> AnsiTransactionManager

Returns the “default value” for a type. Read more
Source§

impl<Conn> TransactionManager<Conn> for AnsiTransactionManager
where Conn: Connection<TransactionManager = Self>,

Source§

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.

Source§

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<()>

Begin a new transaction or savepoint Read more
Source§

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

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
Source§

fn transaction<F, R, E>(conn: &mut Conn, callback: F) -> Result<R, E>
where F: FnOnce(&mut Conn) -> Result<R, E>, E: From<Error>,

Executes the given function inside of a database transaction Read more
Source§

fn is_broken_transaction_manager(conn: &mut Conn) -> bool

Available on crate feature i-implement-a-third-party-backend-and-opt-into-breaking-changes only.
This methods checks if the connection manager is considered to be broken by connection pool implementations Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoSql for T

Source§

fn into_sql<T>(self) -> AsExprOf<Self, T>

Convert self to an expression for Diesel’s query builder. Read more
Source§

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T