Struct rsfbclient::SimpleTransaction
source · pub struct SimpleTransaction<'c> { /* private fields */ }
Expand description
A transaction API without client types
Implementations§
source§impl<'c> SimpleTransaction<'c>
impl<'c> SimpleTransaction<'c>
sourcepub fn new(
conn: &'c mut SimpleConnection,
confs: TransactionConfiguration
) -> Result<Self, FbError>
pub fn new( conn: &'c mut SimpleConnection, 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> Execute for SimpleTransaction<'c>
impl<'c> Execute for SimpleTransaction<'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>
impl<'c> From<Transaction<'c, NativeFbClient<DynLink>>> for SimpleTransaction<'c>
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>
impl<'c> From<Transaction<'c, NativeFbClient<DynLoad>>> for SimpleTransaction<'c>
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>
impl<'c> From<Transaction<'c, RustFbClient>> for SimpleTransaction<'c>
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> Queryable for SimpleTransaction<'c>
impl<'c> Queryable for SimpleTransaction<'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>>
impl<'c> TryFrom<SimpleTransaction<'c>> for Transaction<'c, NativeFbClient<DynLink>>
source§impl<'c> TryFrom<SimpleTransaction<'c>> for Transaction<'c, NativeFbClient<DynLoad>>
impl<'c> TryFrom<SimpleTransaction<'c>> for Transaction<'c, NativeFbClient<DynLoad>>
source§impl<'c> TryFrom<SimpleTransaction<'c>> for Transaction<'c, RustFbClient>
impl<'c> TryFrom<SimpleTransaction<'c>> for Transaction<'c, RustFbClient>
Auto Trait Implementations§
impl<'c> !RefUnwindSafe for SimpleTransaction<'c>
impl<'c> Send for SimpleTransaction<'c>
impl<'c> !Sync for SimpleTransaction<'c>
impl<'c> Unpin for SimpleTransaction<'c>
impl<'c> !UnwindSafe for SimpleTransaction<'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