Skip to main content

EasyExecutor

Trait EasyExecutor 

Source
pub trait EasyExecutor<D: Driver> {
    type InternalExecutor<'b>: Executor<'b, Database = D::InternalDriver>
       where Self: 'b;
    type IntoInternalExecutor<'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>;
    fn into_executor<'a>(self) -> Self::IntoInternalExecutor<'a>
       where Self: '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

Source

type IntoInternalExecutor<'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>

Source

fn into_executor<'a>(self) -> Self::IntoInternalExecutor<'a>
where Self: '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.

Implementors§

Source§

impl<'c, D: Driver> EasyExecutor<D> for &mut 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§

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

Source§

impl<D: Driver> EasyExecutor<D> for &mut 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§

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