Struct sea_orm::DatabaseTransaction
source · [−]pub struct DatabaseTransaction { /* private fields */ }
Expand description
Defines a database transaction, whether it is an open transaction and the type of backend to use
Implementations
Trait Implementations
sourceimpl ConnectionTrait for DatabaseTransaction
impl ConnectionTrait for DatabaseTransaction
sourcefn get_database_backend(&self) -> DbBackend
fn get_database_backend(&self) -> DbBackend
sourcefn execute<'life0, 'async_trait>(
&'life0 self,
stmt: Statement
) -> Pin<Box<dyn Future<Output = Result<ExecResult, DbErr>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
stmt: Statement
) -> Pin<Box<dyn Future<Output = Result<ExecResult, DbErr>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Execute a Statement
sourcefn query_one<'life0, 'async_trait>(
&'life0 self,
stmt: Statement
) -> Pin<Box<dyn Future<Output = Result<Option<QueryResult>, DbErr>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn query_one<'life0, 'async_trait>(
&'life0 self,
stmt: Statement
) -> Pin<Box<dyn Future<Output = Result<Option<QueryResult>, DbErr>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Execute a Statement and return a query
sourcefn query_all<'life0, 'async_trait>(
&'life0 self,
stmt: Statement
) -> Pin<Box<dyn Future<Output = Result<Vec<QueryResult>, DbErr>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn query_all<'life0, 'async_trait>(
&'life0 self,
stmt: Statement
) -> Pin<Box<dyn Future<Output = Result<Vec<QueryResult>, DbErr>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Execute a Statement and return a collection Vec<QueryResult> on success
sourcefn support_returning(&self) -> bool
fn support_returning(&self) -> bool
Check if the connection supports RETURNING
syntax on insert and update
sourcefn is_mock_connection(&self) -> bool
fn is_mock_connection(&self) -> bool
Check if the connection is a test connection for the Mock database
sourceimpl Debug for DatabaseTransaction
impl Debug for DatabaseTransaction
sourceimpl Drop for DatabaseTransaction
impl Drop for DatabaseTransaction
sourceimpl<'a> StreamTrait<'a> for DatabaseTransaction
impl<'a> StreamTrait<'a> for DatabaseTransaction
sourceimpl TransactionTrait for DatabaseTransaction
impl TransactionTrait for DatabaseTransaction
sourcefn transaction<'life0, 'async_trait, F, T, E>(
&'life0 self,
_callback: F
) -> Pin<Box<dyn Future<Output = Result<T, TransactionError<E>>> + Send + 'async_trait>> where
F: for<'c> FnOnce(&'c DatabaseTransaction) -> Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'c>> + Send,
T: Send,
E: Error + Send,
F: 'async_trait,
T: 'async_trait,
E: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn transaction<'life0, 'async_trait, F, T, E>(
&'life0 self,
_callback: F
) -> Pin<Box<dyn Future<Output = Result<T, TransactionError<E>>> + Send + 'async_trait>> where
F: for<'c> FnOnce(&'c DatabaseTransaction) -> Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'c>> + Send,
T: Send,
E: Error + Send,
F: 'async_trait,
T: 'async_trait,
E: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Execute the function inside a transaction. If the function returns an error, the transaction will be rolled back. If it does not return an error, the transaction will be committed.
Auto Trait Implementations
impl !RefUnwindSafe for DatabaseTransaction
impl Send for DatabaseTransaction
impl Sync for DatabaseTransaction
impl Unpin for DatabaseTransaction
impl !UnwindSafe for DatabaseTransaction
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more