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 async fn begin_transaction_sql<Conn>(
conn: &mut Conn,
sql: &str,
) -> QueryResult<()>where
Conn: AsyncConnection<TransactionManager = Self>,
pub async fn begin_transaction_sql<Conn>(
conn: &mut Conn,
sql: &str,
) -> QueryResult<()>where
Conn: AsyncConnection<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: AsyncConnection<TransactionManager = Self>,
impl<Conn> TransactionManager<Conn> for AnsiTransactionManagerwhere
Conn: AsyncConnection<TransactionManager = Self>,
Source§fn commit_transaction<'life0, 'async_trait>(
conn: &'life0 mut Conn,
) -> Pin<Box<dyn Future<Output = QueryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn commit_transaction<'life0, 'async_trait>(
conn: &'life0 mut Conn,
) -> Pin<Box<dyn Future<Output = QueryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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
type TransactionStateData = AnsiTransactionManager
Data stored as part of the connection implementation
to track the current transaction state of a connection
Source§fn begin_transaction<'life0, 'async_trait>(
conn: &'life0 mut Conn,
) -> Pin<Box<dyn Future<Output = QueryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn begin_transaction<'life0, 'async_trait>(
conn: &'life0 mut Conn,
) -> Pin<Box<dyn Future<Output = QueryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Begin a new transaction or savepoint Read more
Source§fn rollback_transaction<'life0, 'async_trait>(
conn: &'life0 mut Conn,
) -> Pin<Box<dyn Future<Output = QueryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn rollback_transaction<'life0, 'async_trait>(
conn: &'life0 mut Conn,
) -> Pin<Box<dyn Future<Output = QueryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Rollback the inner-most transaction or savepoint Read more
Source§fn transaction<'a, 'life0, 'async_trait, F, R, E>(
conn: &'life0 mut Conn,
callback: F,
) -> Pin<Box<dyn Future<Output = Result<R, E>> + Send + 'async_trait>>where
F: for<'r> FnOnce(&'r mut Conn) -> ScopedBoxFuture<'a, 'r, Result<R, E>> + Send + 'a + 'async_trait,
E: From<Error> + Send + 'async_trait,
R: Send + 'async_trait,
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
fn transaction<'a, 'life0, 'async_trait, F, R, E>(
conn: &'life0 mut Conn,
callback: F,
) -> Pin<Box<dyn Future<Output = Result<R, E>> + Send + 'async_trait>>where
F: for<'r> FnOnce(&'r mut Conn) -> ScopedBoxFuture<'a, 'r, Result<R, E>> + Send + 'a + 'async_trait,
E: From<Error> + Send + 'async_trait,
R: Send + 'async_trait,
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Executes the given function inside of a database transaction Read more
Auto Trait Implementations§
impl Freeze for AnsiTransactionManager
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self
to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self
to an expression for Diesel’s query builder. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, Conn> RunQueryDsl<Conn> for T
impl<T, Conn> RunQueryDsl<Conn> for T
Source§fn execute<'conn, 'query>(
self,
conn: &'conn mut Conn,
) -> Conn::ExecuteFuture<'conn, 'query>
fn execute<'conn, 'query>( self, conn: &'conn mut Conn, ) -> Conn::ExecuteFuture<'conn, 'query>
Executes the given command, returning the number of rows affected. Read more
Source§fn load<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> LoadFuture<'conn, 'query, Self, Conn, U>
fn load<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> LoadFuture<'conn, 'query, Self, Conn, U>
Source§fn load_stream<'conn, 'query, U>(
self,
conn: &'conn mut Conn,
) -> Self::LoadFuture<'conn>where
Conn: AsyncConnection,
U: 'conn,
Self: LoadQuery<'query, Conn, U> + 'query,
fn load_stream<'conn, 'query, U>(
self,
conn: &'conn mut Conn,
) -> Self::LoadFuture<'conn>where
Conn: AsyncConnection,
U: 'conn,
Self: LoadQuery<'query, Conn, U> + 'query,
Source§fn get_result<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> GetResult<'conn, 'query, Self, Conn, U>
fn get_result<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> GetResult<'conn, 'query, Self, Conn, U>
Runs the command, and returns the affected row. Read more
Source§fn get_results<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> LoadFuture<'conn, 'query, Self, Conn, U>
fn get_results<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> LoadFuture<'conn, 'query, Self, Conn, U>
Runs the command, returning an
Vec
with the affected rows. Read more