pub struct Transaction<'c, C>where
C: FirebirdClient,{ /* private fields */ }
Implementations§
Source§impl<'c, C: FirebirdClient> Transaction<'c, C>
impl<'c, C: FirebirdClient> Transaction<'c, C>
Sourcepub fn new(
conn: &'c mut Connection<C>,
confs: TransactionConfiguration,
) -> Result<Self, FbError>
pub fn new( conn: &'c mut Connection<C>, confs: TransactionConfiguration, ) -> Result<Self, FbError>
Start a new transaction
Sourcepub fn commit_retaining(&mut self) -> Result<(), FbError>
pub fn commit_retaining(&mut self) -> Result<(), FbError>
Commit the current transaction changes, but allowing to reuse the transaction
Sourcepub fn rollback_retaining(&mut self) -> Result<(), FbError>
pub fn rollback_retaining(&mut self) -> Result<(), FbError>
Rollback the current transaction changes, but allowing to reuse the transaction
Trait Implementations§
Source§impl<'c, C: FirebirdClient> Drop for Transaction<'c, C>
impl<'c, C: FirebirdClient> Drop for Transaction<'c, C>
Source§impl<C: FirebirdClient> Execute for Transaction<'_, C>
impl<C: FirebirdClient> Execute for Transaction<'_, C>
Source§fn execute<P>(&mut self, sql: &str, params: P) -> Result<usize, FbError>where
P: IntoParams,
fn execute<P>(&mut self, sql: &str, params: P) -> Result<usize, FbError>where
P: IntoParams,
Execute a query, may or may not commit the changes
and returns the affected rows count Read more
Source§fn execute_returnable<P, R>(
&mut self,
sql: &str,
params: P,
) -> Result<R, FbError>where
P: IntoParams,
R: FromRow + 'static,
fn execute_returnable<P, R>(
&mut self,
sql: &str,
params: P,
) -> Result<R, FbError>where
P: IntoParams,
R: FromRow + 'static,
Execute a query that will return data, like the ‘insert … returning ..’ or ‘execute procedure’. Read more
Source§impl<'c> From<Transaction<'c, NativeFbClient<DynLink>>> for SimpleTransaction<'c>
Available on crate feature linking
only.
impl<'c> From<Transaction<'c, NativeFbClient<DynLink>>> for SimpleTransaction<'c>
Available on crate feature
linking
only.Source§fn from(tr: Transaction<'c, NativeFbClient<DynLink>>) -> Self
fn from(tr: Transaction<'c, NativeFbClient<DynLink>>) -> Self
Converts to this type from the input type.
Source§impl<'c> From<Transaction<'c, NativeFbClient<DynLoad>>> for SimpleTransaction<'c>
Available on crate feature dynamic_loading
only.
impl<'c> From<Transaction<'c, NativeFbClient<DynLoad>>> for SimpleTransaction<'c>
Available on crate feature
dynamic_loading
only.Source§fn from(tr: Transaction<'c, NativeFbClient<DynLoad>>) -> Self
fn from(tr: Transaction<'c, NativeFbClient<DynLoad>>) -> Self
Converts to this type from the input type.
Source§impl<'c> From<Transaction<'c, RustFbClient>> for SimpleTransaction<'c>
Available on crate feature pure_rust
only.
impl<'c> From<Transaction<'c, RustFbClient>> for SimpleTransaction<'c>
Available on crate feature
pure_rust
only.Source§fn from(tr: Transaction<'c, RustFbClient>) -> Self
fn from(tr: Transaction<'c, RustFbClient>) -> Self
Converts to this type from the input type.
Source§impl<'c, C: FirebirdClient> Queryable for Transaction<'c, C>
impl<'c, C: FirebirdClient> Queryable for Transaction<'c, C>
Source§fn query_iter<'a, P, R>(
&'a mut self,
sql: &str,
params: P,
) -> Result<Box<dyn Iterator<Item = Result<R, FbError>> + 'a>, FbError>where
P: IntoParams,
R: FromRow + 'static,
fn query_iter<'a, P, R>(
&'a mut self,
sql: &str,
params: P,
) -> Result<Box<dyn Iterator<Item = Result<R, FbError>> + 'a>, FbError>where
P: IntoParams,
R: FromRow + 'static,
Returns the results of the query as an iterator. Read more
Source§fn query<P, R>(&mut self, sql: &str, params: P) -> Result<Vec<R>, FbError>where
P: IntoParams,
R: FromRow + 'static,
fn query<P, R>(&mut self, sql: &str, params: P) -> Result<Vec<R>, FbError>where
P: IntoParams,
R: FromRow + 'static,
Returns the results of the query as a
Vec
Read moreSource§fn query_first<P, R>(
&mut self,
sql: &str,
params: P,
) -> Result<Option<R>, FbError>where
P: IntoParams,
R: FromRow + 'static,
fn query_first<P, R>(
&mut self,
sql: &str,
params: P,
) -> Result<Option<R>, FbError>where
P: IntoParams,
R: FromRow + 'static,
Returns the first result of the query, or None. Read more
Source§impl<'c> TryFrom<SimpleTransaction<'c>> for Transaction<'c, NativeFbClient<DynLink>>
Available on crate feature linking
only.
impl<'c> TryFrom<SimpleTransaction<'c>> for Transaction<'c, NativeFbClient<DynLink>>
Available on crate feature
linking
only.Source§impl<'c> TryFrom<SimpleTransaction<'c>> for Transaction<'c, NativeFbClient<DynLoad>>
Available on crate feature dynamic_loading
only.
impl<'c> TryFrom<SimpleTransaction<'c>> for Transaction<'c, NativeFbClient<DynLoad>>
Available on crate feature
dynamic_loading
only.Source§impl<'c> TryFrom<SimpleTransaction<'c>> for Transaction<'c, RustFbClient>
Available on crate feature pure_rust
only.
impl<'c> TryFrom<SimpleTransaction<'c>> for Transaction<'c, RustFbClient>
Available on crate feature
pure_rust
only.Auto Trait Implementations§
impl<'c, C> Freeze for Transaction<'c, C>
impl<'c, C> RefUnwindSafe for Transaction<'c, C>where
<C as FirebirdClientSqlOps>::TrHandle: RefUnwindSafe,
<C as FirebirdClientDbOps>::DbHandle: RefUnwindSafe,
C: RefUnwindSafe,
<C as FirebirdClientSqlOps>::StmtHandle: RefUnwindSafe,
impl<'c, C> Send for Transaction<'c, C>
impl<'c, C> Sync for Transaction<'c, C>where
<C as FirebirdClientSqlOps>::TrHandle: Sync,
<C as FirebirdClientDbOps>::DbHandle: Sync,
C: Sync,
<C as FirebirdClientSqlOps>::StmtHandle: Sync,
impl<'c, C> Unpin for Transaction<'c, C>
impl<'c, C> !UnwindSafe for Transaction<'c, C>
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