pub trait GenericClient: Sealed {
    fn execute<T>(
        &mut self,
        query: &T,
        params: &[&(dyn ToSql + Sync)]
    ) -> Result<u64, Error>
    where
        T: ?Sized + ToStatement
; fn query<T>(
        &mut self,
        query: &T,
        params: &[&(dyn ToSql + Sync)]
    ) -> Result<Vec<Row>, Error>
    where
        T: ?Sized + ToStatement
; fn query_one<T>(
        &mut self,
        query: &T,
        params: &[&(dyn ToSql + Sync)]
    ) -> Result<Row, Error>
    where
        T: ?Sized + ToStatement
; fn query_opt<T>(
        &mut self,
        query: &T,
        params: &[&(dyn ToSql + Sync)]
    ) -> Result<Option<Row>, Error>
    where
        T: ?Sized + ToStatement
; fn query_raw<T, P, I>(
        &mut self,
        query: &T,
        params: I
    ) -> Result<RowIter<'_>, Error>
    where
        T: ?Sized + ToStatement,
        P: BorrowToSql,
        I: IntoIterator<Item = P>,
        I::IntoIter: ExactSizeIterator
; fn prepare(&mut self, query: &str) -> Result<Statement, Error>; fn prepare_typed(
        &mut self,
        query: &str,
        types: &[Type]
    ) -> Result<Statement, Error>; fn copy_in<T>(&mut self, query: &T) -> Result<CopyInWriter<'_>, Error>
    where
        T: ?Sized + ToStatement
; fn copy_out<T>(&mut self, query: &T) -> Result<CopyOutReader<'_>, Error>
    where
        T: ?Sized + ToStatement
; fn simple_query(
        &mut self,
        query: &str
    ) -> Result<Vec<SimpleQueryMessage>, Error>; fn batch_execute(&mut self, query: &str) -> Result<(), Error>; fn transaction(&mut self) -> Result<Transaction<'_>, Error>; }
Expand description

A trait allowing abstraction over connections and transactions.

This trait is “sealed”, and cannot be implemented outside of this crate.

Required Methods

Like Client::execute.

Like Client::query.

Like Client::query_one.

Like Client::query_opt.

Like Client::query_raw.

Like Client::prepare.

Like Client::prepare_typed.

Like Client::copy_in.

Like Client::copy_out.

Like Client::simple_query.

Like Client::batch_execute.

Like Client::transaction.

Implementors