[][src]Trait rsfbclient_core::FirebirdClient

pub trait FirebirdClient: Send {
    type DbHandle: Send + Clone + Copy;
    type TrHandle: Send + Clone + Copy;
    type StmtHandle: Send + Clone + Copy;
    type Args: Send + Sync + Clone;
    fn new(charset: Charset, args: Self::Args) -> Result<Self, FbError>
    where
        Self: Sized
;
fn detach_database(
        &mut self,
        db_handle: Self::DbHandle
    ) -> Result<(), FbError>;
fn drop_database(
        &mut self,
        db_handle: Self::DbHandle
    ) -> Result<(), FbError>;
fn begin_transaction(
        &mut self,
        db_handle: Self::DbHandle,
        isolation_level: TrIsolationLevel
    ) -> Result<Self::TrHandle, FbError>;
fn transaction_operation(
        &mut self,
        tr_handle: Self::TrHandle,
        op: TrOp
    ) -> Result<(), FbError>;
fn exec_immediate(
        &mut self,
        db_handle: Self::DbHandle,
        tr_handle: Self::TrHandle,
        dialect: Dialect,
        sql: &str
    ) -> Result<(), FbError>;
fn prepare_statement(
        &mut self,
        db_handle: Self::DbHandle,
        tr_handle: Self::TrHandle,
        dialect: Dialect,
        sql: &str
    ) -> Result<(StmtType, Self::StmtHandle), FbError>;
fn free_statement(
        &mut self,
        stmt_handle: Self::StmtHandle,
        op: FreeStmtOp
    ) -> Result<(), FbError>;
fn execute(
        &mut self,
        db_handle: Self::DbHandle,
        tr_handle: Self::TrHandle,
        stmt_handle: Self::StmtHandle,
        params: Vec<Param>
    ) -> Result<(), FbError>;
fn fetch(
        &mut self,
        db_handle: Self::DbHandle,
        tr_handle: Self::TrHandle,
        stmt_handle: Self::StmtHandle
    ) -> Result<Option<Vec<Column>>, FbError>; }

Associated Types

type DbHandle: Send + Clone + Copy

A database handle

type TrHandle: Send + Clone + Copy

A transaction handle

type StmtHandle: Send + Clone + Copy

A statement handle

type Args: Send + Sync + Clone

Arguments to instantiate the client

Loading content...

Required methods

fn new(charset: Charset, args: Self::Args) -> Result<Self, FbError> where
    Self: Sized

fn detach_database(&mut self, db_handle: Self::DbHandle) -> Result<(), FbError>

Disconnect from the database

fn drop_database(&mut self, db_handle: Self::DbHandle) -> Result<(), FbError>

Drop the database

fn begin_transaction(
    &mut self,
    db_handle: Self::DbHandle,
    isolation_level: TrIsolationLevel
) -> Result<Self::TrHandle, FbError>

Start a new transaction, with the specified transaction parameter buffer

fn transaction_operation(
    &mut self,
    tr_handle: Self::TrHandle,
    op: TrOp
) -> Result<(), FbError>

Commit / Rollback a transaction

fn exec_immediate(
    &mut self,
    db_handle: Self::DbHandle,
    tr_handle: Self::TrHandle,
    dialect: Dialect,
    sql: &str
) -> Result<(), FbError>

Execute a sql immediately, without returning rows

fn prepare_statement(
    &mut self,
    db_handle: Self::DbHandle,
    tr_handle: Self::TrHandle,
    dialect: Dialect,
    sql: &str
) -> Result<(StmtType, Self::StmtHandle), FbError>

Alloc and prepare a statement

Returns the statement type and handle

fn free_statement(
    &mut self,
    stmt_handle: Self::StmtHandle,
    op: FreeStmtOp
) -> Result<(), FbError>

Closes or drops a statement

fn execute(
    &mut self,
    db_handle: Self::DbHandle,
    tr_handle: Self::TrHandle,
    stmt_handle: Self::StmtHandle,
    params: Vec<Param>
) -> Result<(), FbError>

Execute the prepared statement with parameters

fn fetch(
    &mut self,
    db_handle: Self::DbHandle,
    tr_handle: Self::TrHandle,
    stmt_handle: Self::StmtHandle
) -> Result<Option<Vec<Column>>, FbError>

Fetch rows from the executed statement, coercing the types according to the provided blr

Loading content...

Implementors

Loading content...