Skip to main content

EasyExecutor

Trait EasyExecutor 

Source
pub trait EasyExecutor<D: Driver> {
    type InternalExecutor<'b>: Executor<'b, Database = D::InternalDriver>
       where Self: 'b;

    // Required methods
    async fn query_setup<O: SetupSql<D> + Send + Sync>(
        &mut self,
        sql: O,
    ) -> Result<O::Output>
       where DriverConnection<D>: Send + Sync;
    fn executor<'a>(&'a mut self) -> Self::InternalExecutor<'a>;
}
Expand description

Abstraction over sqlx::Executor used by the query macros.

Implemented for easy_sql and sqlx connections/pools; most users only need to pass a compatible connection to query! or query_lazy!.

Will contain sql query watch functions in the future (gated by a feature)

Required Associated Types§

Source

type InternalExecutor<'b>: Executor<'b, Database = D::InternalDriver> where Self: 'b

Required Methods§

Source

async fn query_setup<O: SetupSql<D> + Send + Sync>( &mut self, sql: O, ) -> Result<O::Output>

Source

fn executor<'a>(&'a mut self) -> Self::InternalExecutor<'a>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<D: Driver, E: EasyExecutor<D> + ?Sized> EasyExecutor<D> for &mut E

Source§

type InternalExecutor<'b> = <E as EasyExecutor<D>>::InternalExecutor<'b> where Self: 'b

Source§

async fn query_setup<O: SetupSql<D> + Send + Sync>( &mut self, sql: O, ) -> Result<O::Output>

Source§

fn executor<'a>(&'a mut self) -> Self::InternalExecutor<'a>

Implementors§

Source§

impl<'c, D: Driver> EasyExecutor<D> for Transaction<'c, D>
where for<'b> &'b mut DriverConnection<D>: Executor<'b, Database = D::InternalDriver>,

Source§

type InternalExecutor<'b> = &'b mut <<D as Driver>::InternalDriver as Database>::Connection where Self: 'b

Source§

impl<D: Driver> EasyExecutor<D> for Connection<D>
where for<'b> &'b mut DriverConnection<D>: Executor<'b, Database = D::InternalDriver>,

Source§

type InternalExecutor<'b> = &'b mut <<D as Driver>::InternalDriver as Database>::Connection where Self: 'b

Source§

impl<D: Driver> EasyExecutor<D> for PoolTransaction<D>
where for<'b> &'b mut DriverConnection<D>: Executor<'b, Database = D::InternalDriver>,

Source§

type InternalExecutor<'b> = &'b mut <<D as Driver>::InternalDriver as Database>::Connection where Self: 'b