Trait rsfbclient::Execute

source ·
pub trait Execute {
    // Required methods
    fn execute<P>(&mut self, sql: &str, params: P) -> Result<usize, FbError>
       where P: IntoParams;
    fn execute_returnable<P, R>(
        &mut self,
        sql: &str,
        params: P
    ) -> Result<R, FbError>
       where P: IntoParams,
             R: FromRow + 'static;
}
Expand description

Implemented for types that can be used to execute sql statements

Required Methods§

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

possible values for argument params:

(): no parameters,

(param0, param1, param2...): a tuple of IntoParam values corresponding to positional ? sql parameters

A struct for which IntoParams has been derived (see there for details)

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

This method is designated for use in cases when you don’t have a cursor to fetch. This link explain the Firebird behavior for this cases.

possible values for argument params:

(): no parameters,

(param0, param1, param2...): a tuple of IntoParam values corresponding to positional ? sql parameters

A struct for which IntoParams has been derived (see there for details)

Object Safety§

This trait is not object safe.

Implementors§