[][src]Trait rsfbclient::Queryable

pub trait Queryable<'a, R> where
    R: FromRow + 'a, 
{ type Iter: Iterator<Item = Result<R, FbError>> + 'a; fn query_iter<P>(
        &'a mut self,
        sql: &str,
        params: P
    ) -> Result<Self::Iter, FbError>
    where
        P: IntoParams
; fn query<P>(&'a mut self, sql: &str, params: P) -> Result<Vec<R>, FbError>
    where
        P: IntoParams
, { ... }
fn query_first<P>(
        &'a mut self,
        sql: &str,
        params: P
    ) -> Result<Option<R>, FbError>
    where
        P: IntoParams
, { ... } }

Implemented for types that can be used to execute sql queries

Associated Types

type Iter: Iterator<Item = Result<R, FbError>> + 'a

Loading content...

Required methods

fn query_iter<P>(
    &'a mut self,
    sql: &str,
    params: P
) -> Result<Self::Iter, FbError> where
    P: IntoParams

Returns the results of the query as an iterator

Use () for no parameters or a tuple of parameters

Loading content...

Provided methods

fn query<P>(&'a mut self, sql: &str, params: P) -> Result<Vec<R>, FbError> where
    P: IntoParams

Returns the results of the query as a Vec

Use () for no parameters or a tuple of parameters

fn query_first<P>(
    &'a mut self,
    sql: &str,
    params: P
) -> Result<Option<R>, FbError> where
    P: IntoParams

Returns the first result of the query, or None

Use () for no parameters or a tuple of parameters

Loading content...

Implementors

impl<'a, R, C> Queryable<'a, R> for Connection<C> where
    R: FromRow + 'a,
    C: FirebirdClient + 'a, 
[src]

type Iter = StmtIter<'a, R, C>

fn query_iter<P>(
    &'a mut self,
    sql: &str,
    params: P
) -> Result<Self::Iter, FbError> where
    P: IntoParams
[src]

Prepare, execute, return the rows and commit the sql query

Use () for no parameters or a tuple of parameters

impl<'a, R, C> Queryable<'a, R> for Transaction<'a, C> where
    R: FromRow + 'a,
    C: FirebirdClient
[src]

type Iter = StmtIter<'a, R, C>

fn query_iter<P>(
    &'a mut self,
    sql: &str,
    params: P
) -> Result<Self::Iter, FbError> where
    P: IntoParams
[src]

Prepare, execute and return the rows of the sql query

Use () for no parameters or a tuple of parameters

Loading content...