Skip to main content

Executor

Trait Executor 

Source
pub trait Executor: Sealed {
    // Required methods
    fn query_raw(
        &self,
        sql: &str,
        sql_hash: u64,
        params: &[&(dyn Encode + Sync)],
    ) -> impl Future<Output = BsqlResult<OwnedResult>> + Send;
    fn query_raw_readonly(
        &self,
        sql: &str,
        sql_hash: u64,
        params: &[&(dyn Encode + Sync)],
    ) -> impl Future<Output = BsqlResult<OwnedResult>> + Send;
    fn execute_raw(
        &self,
        sql: &str,
        sql_hash: u64,
        params: &[&(dyn Encode + Sync)],
    ) -> impl Future<Output = BsqlResult<u64>> + Send;
}
Expand description

Execute a prepared query and return rows.

This trait is sealed — it cannot be implemented outside of bsql-core. The generated code calls query_raw, query_raw_readonly, and execute_raw on &Pool, &PoolConnection, or &Transaction.

Required Methods§

Source

fn query_raw( &self, sql: &str, sql_hash: u64, params: &[&(dyn Encode + Sync)], ) -> impl Future<Output = BsqlResult<OwnedResult>> + Send

Execute a query and return all rows.

Source

fn query_raw_readonly( &self, sql: &str, sql_hash: u64, params: &[&(dyn Encode + Sync)], ) -> impl Future<Output = BsqlResult<OwnedResult>> + Send

Execute a read-only query. May route to replicas in the future.

Source

fn execute_raw( &self, sql: &str, sql_hash: u64, params: &[&(dyn Encode + Sync)], ) -> impl Future<Output = BsqlResult<u64>> + Send

Execute a query and return the number of affected rows.

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§