pub struct SimpleTransaction<'c> { /* private fields */ }
Expand description

A transaction API without client types

Implementations§

source§

impl<'c> SimpleTransaction<'c>

source

pub fn new( conn: &'c mut SimpleConnection, confs: TransactionConfiguration ) -> Result<Self, FbError>

Start a new transaction

source

pub fn commit(self) -> Result<(), FbError>

Commit the current transaction changes

source

pub fn commit_retaining(&mut self) -> Result<(), FbError>

Commit the current transaction changes, but allowing to reuse the transaction

source

pub fn rollback_retaining(&mut self) -> Result<(), FbError>

Rollback the current transaction changes, but allowing to reuse the transaction

source

pub fn rollback(self) -> Result<(), FbError>

Rollback the current transaction changes

source

pub fn execute_immediate(&mut self, sql: &str) -> Result<(), FbError>

Execute the statement without returning any row

Trait Implementations§

source§

impl<'c> Execute for SimpleTransaction<'c>

source§

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,

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>

source§

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>

source§

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>

source§

fn from(tr: Transaction<'c, RustFbClient>) -> Self

Converts to this type from the input type.
source§

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,

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,

Returns the results of the query as a Vec Read more
source§

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

§

type Error = FbError

The type returned in the event of a conversion error.
source§

fn try_from(tr: SimpleTransaction<'c>) -> Result<Self, FbError>

Performs the conversion.
source§

impl<'c> TryFrom<SimpleTransaction<'c>> for Transaction<'c, NativeFbClient<DynLoad>>

§

type Error = FbError

The type returned in the event of a conversion error.
source§

fn try_from(tr: SimpleTransaction<'c>) -> Result<Self, FbError>

Performs the conversion.
source§

impl<'c> TryFrom<SimpleTransaction<'c>> for Transaction<'c, RustFbClient>

§

type Error = FbError

The type returned in the event of a conversion error.
source§

fn try_from(tr: SimpleTransaction<'c>) -> Result<Self, FbError>

Performs the conversion.

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> 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> Same for T

§

type Output = T

Should always be Self
source§

impl<T> SystemInfos for T
where T: Queryable,

source§

fn db_name(&mut self) -> Result<String, FbError>

Return the current connected database name
source§

fn server_engine(&mut self) -> Result<EngineVersion, FbError>

Return the current server version
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V