Trait rsfbclient::Queryable[][src]

pub trait Queryable {
    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
; fn query<P, R>(&mut self, sql: &str, params: P) -> Result<Vec<R>, FbError>
    where
        P: IntoParams,
        R: FromRow + 'static
, { ... }
fn query_first<P, R>(
        &mut self,
        sql: &str,
        params: P
    ) -> Result<Option<R>, FbError>
    where
        P: IntoParams,
        R: FromRow + 'static
, { ... } }

Implemented for types that can be used to execute sql queries

Required methods

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, 
[src]

Returns the results of the query as an iterator.

The query must be return an open cursor, so for cases like ‘insert .. returning’ you will need to use the execute_returnable method instead.

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)

Loading content...

Provided methods

fn query<P, R>(&mut self, sql: &str, params: P) -> Result<Vec<R>, FbError> where
    P: IntoParams,
    R: FromRow + 'static, 
[src]

Returns the results of the query as a Vec

The query must be return an open cursor, so for cases like ‘insert .. returning’ you will need to use the execute_returnable method instead.

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)

fn query_first<P, R>(
    &mut self,
    sql: &str,
    params: P
) -> Result<Option<R>, FbError> where
    P: IntoParams,
    R: FromRow + 'static, 
[src]

Returns the first result of the query, or None.

The query must be return an open cursor, so for cases like ‘insert .. returning’ you will need to use the execute_returnable method instead.

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)

Loading content...

Implementors

impl Queryable for SimpleConnection[src]

impl<'c> Queryable for SimpleTransaction<'c>[src]

impl<'c, C: FirebirdClient> Queryable for Transaction<'c, C>[src]

impl<C> Queryable for Connection<C> where
    C: FirebirdClient
[src]

Loading content...