pub trait FirebirdClientSqlOps {
type DbHandle: Send;
type TrHandle: Send;
type StmtHandle: Send;
// Required methods
fn begin_transaction(
&mut self,
db_handle: &mut Self::DbHandle,
confs: TransactionConfiguration,
) -> Result<Self::TrHandle, FbError>;
fn transaction_operation(
&mut self,
tr_handle: &mut Self::TrHandle,
op: TrOp,
) -> Result<(), FbError>;
fn exec_immediate(
&mut self,
db_handle: &mut Self::DbHandle,
tr_handle: &mut Self::TrHandle,
dialect: Dialect,
sql: &str,
) -> Result<(), FbError>;
fn prepare_statement(
&mut self,
db_handle: &mut Self::DbHandle,
tr_handle: &mut Self::TrHandle,
dialect: Dialect,
sql: &str,
) -> Result<(StmtType, Self::StmtHandle), FbError>;
fn free_statement(
&mut self,
stmt_handle: &mut Self::StmtHandle,
op: FreeStmtOp,
) -> Result<(), FbError>;
fn execute(
&mut self,
db_handle: &mut Self::DbHandle,
tr_handle: &mut Self::TrHandle,
stmt_handle: &mut Self::StmtHandle,
params: Vec<SqlType>,
) -> Result<usize, FbError>;
fn execute2(
&mut self,
db_handle: &mut Self::DbHandle,
tr_handle: &mut Self::TrHandle,
stmt_handle: &mut Self::StmtHandle,
params: Vec<SqlType>,
) -> Result<Vec<Column>, FbError>;
fn fetch(
&mut self,
db_handle: &mut Self::DbHandle,
tr_handle: &mut Self::TrHandle,
stmt_handle: &mut Self::StmtHandle,
) -> Result<Option<Vec<Column>>, FbError>;
}Expand description
Responsible for actual transaction and statement execution
Required Associated Types§
Sourcetype StmtHandle: Send
type StmtHandle: Send
A statement handle
Required Methods§
Sourcefn begin_transaction(
&mut self,
db_handle: &mut Self::DbHandle,
confs: TransactionConfiguration,
) -> Result<Self::TrHandle, FbError>
fn begin_transaction( &mut self, db_handle: &mut Self::DbHandle, confs: TransactionConfiguration, ) -> Result<Self::TrHandle, FbError>
Start a new transaction, with the specified transaction parameter buffer
Sourcefn transaction_operation(
&mut self,
tr_handle: &mut Self::TrHandle,
op: TrOp,
) -> Result<(), FbError>
fn transaction_operation( &mut self, tr_handle: &mut Self::TrHandle, op: TrOp, ) -> Result<(), FbError>
Commit / Rollback a transaction
Sourcefn exec_immediate(
&mut self,
db_handle: &mut Self::DbHandle,
tr_handle: &mut Self::TrHandle,
dialect: Dialect,
sql: &str,
) -> Result<(), FbError>
fn exec_immediate( &mut self, db_handle: &mut Self::DbHandle, tr_handle: &mut Self::TrHandle, dialect: Dialect, sql: &str, ) -> Result<(), FbError>
Execute a sql immediately, without returning rows
Sourcefn prepare_statement(
&mut self,
db_handle: &mut Self::DbHandle,
tr_handle: &mut Self::TrHandle,
dialect: Dialect,
sql: &str,
) -> Result<(StmtType, Self::StmtHandle), FbError>
fn prepare_statement( &mut self, db_handle: &mut Self::DbHandle, tr_handle: &mut Self::TrHandle, dialect: Dialect, sql: &str, ) -> Result<(StmtType, Self::StmtHandle), FbError>
Allocate and prepare a statement Returns the statement type and handle
Sourcefn free_statement(
&mut self,
stmt_handle: &mut Self::StmtHandle,
op: FreeStmtOp,
) -> Result<(), FbError>
fn free_statement( &mut self, stmt_handle: &mut Self::StmtHandle, op: FreeStmtOp, ) -> Result<(), FbError>
Closes or drops a statement
Sourcefn execute(
&mut self,
db_handle: &mut Self::DbHandle,
tr_handle: &mut Self::TrHandle,
stmt_handle: &mut Self::StmtHandle,
params: Vec<SqlType>,
) -> Result<usize, FbError>
fn execute( &mut self, db_handle: &mut Self::DbHandle, tr_handle: &mut Self::TrHandle, stmt_handle: &mut Self::StmtHandle, params: Vec<SqlType>, ) -> Result<usize, FbError>
Execute the prepared statement with parameters and returns the affected rows count
Sourcefn execute2(
&mut self,
db_handle: &mut Self::DbHandle,
tr_handle: &mut Self::TrHandle,
stmt_handle: &mut Self::StmtHandle,
params: Vec<SqlType>,
) -> Result<Vec<Column>, FbError>
fn execute2( &mut self, db_handle: &mut Self::DbHandle, tr_handle: &mut Self::TrHandle, stmt_handle: &mut Self::StmtHandle, params: Vec<SqlType>, ) -> Result<Vec<Column>, FbError>
Execute the prepared statement with input and output parameters.
The output parameters will be returned as in the Result
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".