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

Create a new transaction manager

Source

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§

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

Source§

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.

Source§

fn begin_transaction(&self, conn: &Conn) -> QueryResult<()>

Begin a new transaction or savepoint Read more
Source§

fn rollback_transaction(&self, conn: &Conn) -> QueryResult<()>

Rollback the inner-most transaction or savepoint Read more
Source§

fn get_transaction_depth(&self) -> u32

Fetch the current transaction depth 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> 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>
where Self: AsExpression<T> + Sized,

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>,

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.