[][src]Trait sqlx_core::executor::Executor

pub trait Executor where
    Self: Send
{ type Database: Database; fn execute<'e, 'q: 'e, 'c: 'e, E: 'e>(
        &'c mut self,
        query: E
    ) -> BoxFuture<'e, Result<u64>>
    where
        E: Execute<'q, Self::Database>
;
fn fetch<'e, 'q, E>(
        &'e mut self,
        query: E
    ) -> <Self::Database as HasCursor<'e, 'q>>::Cursor
    where
        E: Execute<'q, Self::Database>
; }

A type that contains or can provide a database connection to use for executing queries against the database.

No guarantees are provided that successive queries run on the same physical database connection. A Connection is an Executor that guarantees that successive queries are run on the same physical database connection.

Implementations are provided for &Pool, &mut PoolConnection, and &mut Connection.

Associated Types

type Database: Database

The specific database that this type is implemented for.

Loading content...

Required methods

fn execute<'e, 'q: 'e, 'c: 'e, E: 'e>(
    &'c mut self,
    query: E
) -> BoxFuture<'e, Result<u64>> where
    E: Execute<'q, Self::Database>, 

Executes the query for its side-effects and discarding any potential result rows.

Returns the number of rows affected, or 0 if not applicable.

fn fetch<'e, 'q, E>(
    &'e mut self,
    query: E
) -> <Self::Database as HasCursor<'e, 'q>>::Cursor where
    E: Execute<'q, Self::Database>, 

Executes a query for its result.

Returns a Cursor that can be used to iterate through the Rows of the result.

Loading content...

Implementations on Foreign Types

impl<'_, T> Executor for &'_ mut T where
    T: Executor
[src]

type Database = T::Database

Loading content...

Implementors

impl<'p, C, DB> Executor for &'p Pool<C> where
    C: Connect<Database = DB>,
    DB: Database<Connection = C>,
    DB: for<'c, 'q> HasCursor<'c, 'q, Database = DB>, 
[src]

type Database = DB

impl<C> Executor for PoolConnection<C> where
    C: Connect
[src]

type Database = C::Database

impl<DB, C> Executor for Transaction<C> where
    DB: Database,
    C: Connection<Database = DB>, 
[src]

type Database = C::Database

Loading content...