pub struct SimpleConnection { /* private fields */ }
Expand description

A connection API without client types

Implementations§

source§

impl SimpleConnection

source

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

Drop the current database

source

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

Close the current connection.

source

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

Begins a new transaction, and instructs all the query and execute methods performed in the SimpleConnection type to not automatically commit and rollback until commit or rollback are called

source

pub fn begin_transaction_config( &mut self, confs: TransactionConfiguration ) -> Result<(), FbError>

Begins a new transaction with a custom transaction configuration, and instructs all the query and execute methods performed in the SimpleConnection type to not automatically commit and rollback until commit or rollback are called

source

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

Commit the default transaction

source

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

Rollback the default transaction

source

pub fn wait_for_event(&mut self, name: String) -> Result<(), FbError>

Wait for an event to be posted on database

Trait Implementations§

source§

impl Execute for SimpleConnection

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 From<Connection<NativeFbClient<DynLink>>> for SimpleConnection

source§

fn from(conn: Connection<NativeFbClient<DynLink>>) -> Self

Converts to this type from the input type.
source§

impl From<Connection<NativeFbClient<DynLoad>>> for SimpleConnection

source§

fn from(conn: Connection<NativeFbClient<DynLoad>>) -> Self

Converts to this type from the input type.
source§

impl From<Connection<RustFbClient>> for SimpleConnection

source§

fn from(conn: Connection<RustFbClient>) -> Self

Converts to this type from the input type.
source§

impl Queryable for SimpleConnection

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<F, C> RemoteEventsManager<F, C> for SimpleConnection

source§

fn listen_event( self, name: String, handler: F ) -> Result<JoinHandle<Result<(), FbError>>, FbError>

Start the event listener on a thread Read more
source§

impl TryFrom<SimpleConnection> for Connection<NativeFbClient<DynLink>>

§

type Error = FbError

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

fn try_from(conn: SimpleConnection) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<SimpleConnection> for Connection<NativeFbClient<DynLoad>>

§

type Error = FbError

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

fn try_from(conn: SimpleConnection) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<SimpleConnection> for Connection<RustFbClient>

§

type Error = FbError

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

fn try_from(conn: SimpleConnection) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

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