[][src]Trait rsfbclient::Queryable

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

Returns the results of the query as an iterator

Use () for no parameters or a tuple of parameters

Loading content...

Provided methods

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

Returns the results of the query as a Vec

Use () for no parameters or a tuple of parameters

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

Returns the first result of the query, or None

Use () for no parameters or a tuple of parameters

Loading content...

Implementors

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

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]

Prepare, execute and return the rows of the sql query

Use () for no parameters or a tuple of parameters

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

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]

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

Use () for no parameters or a tuple of parameters

Loading content...