Skip to main content

DbExecutor

Trait DbExecutor 

Source
pub trait DbExecutor: Send + Sync {
    // Required methods
    fn execute<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: ExecRequest<'life1>,
    ) -> Pin<Box<dyn Future<Output = Result<ExecOutcome, ExecError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn prepare_only<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: ExecRequest<'life1>,
    ) -> Pin<Box<dyn Future<Output = Result<DryRunOutcome, ExecError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn tx_begin<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _session_name: &'life1 str,
        _session_cfg: &'life2 SessionConfig,
        _read_only: bool,
    ) -> Pin<Box<dyn Future<Output = Result<(), ExecError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn tx_commit<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _session_name: &'life1 str,
        _session_cfg: &'life2 SessionConfig,
    ) -> Pin<Box<dyn Future<Output = Result<(), ExecError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn tx_rollback<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _session_name: &'life1 str,
        _session_cfg: &'life2 SessionConfig,
    ) -> Pin<Box<dyn Future<Output = Result<(), ExecError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn execute_streaming<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        req: ExecRequest<'life1>,
        sink: &'life2 mut (dyn RowSink + Send),
    ) -> Pin<Box<dyn Future<Output = Result<StreamOutcome, ExecError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn invalidate_sessions<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _session_names: &'life1 [String],
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn shutdown<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}

Required Methods§

Source

fn execute<'life0, 'life1, 'async_trait>( &'life0 self, req: ExecRequest<'life1>, ) -> Pin<Box<dyn Future<Output = Result<ExecOutcome, ExecError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn prepare_only<'life0, 'life1, 'async_trait>( &'life0 self, req: ExecRequest<'life1>, ) -> Pin<Box<dyn Future<Output = Result<DryRunOutcome, ExecError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Validate sql and the param shape without running the statement. The server prepares the statement inside a transaction that is rolled back, returning the inferred parameter types and column metadata.

Provided Methods§

Source

fn tx_begin<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_name: &'life1 str, _session_cfg: &'life2 SessionConfig, _read_only: bool, ) -> Pin<Box<dyn Future<Output = Result<(), ExecError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Open an explicit transaction on the named session. Subsequent execute/execute_streaming calls on that session bypass the implicit per-query BEGIN..COMMIT wrap until tx_commit or tx_rollback is called.

Source

fn tx_commit<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_name: &'life1 str, _session_cfg: &'life2 SessionConfig, ) -> Pin<Box<dyn Future<Output = Result<(), ExecError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn tx_rollback<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_name: &'life1 str, _session_cfg: &'life2 SessionConfig, ) -> Pin<Box<dyn Future<Output = Result<(), ExecError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn execute_streaming<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, req: ExecRequest<'life1>, sink: &'life2 mut (dyn RowSink + Send), ) -> Pin<Box<dyn Future<Output = Result<StreamOutcome, ExecError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn invalidate_sessions<'life0, 'life1, 'async_trait>( &'life0 self, _session_names: &'life1 [String], ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn shutdown<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§