pub trait Executor {
// Required methods
fn query_raw(
&self,
sql: &str,
sql_hash: u64,
params: &[&(dyn Encode + Sync)],
) -> BsqlResult<OwnedResult>;
fn query_raw_readonly(
&self,
sql: &str,
sql_hash: u64,
params: &[&(dyn Encode + Sync)],
) -> BsqlResult<OwnedResult>;
fn execute_raw(
&self,
sql: &str,
sql_hash: u64,
params: &[&(dyn Encode + Sync)],
) -> BsqlResult<u64>;
}Expand description
Execute a prepared query and return rows.
The generated code calls query_raw, query_raw_readonly, and
execute_raw on &Pool, &PoolConnection, or &Transaction.
When the async feature is enabled and the pool connects via TCP,
acquire_async() returns true async connections that use tokio I/O
instead of blocking the worker thread. UDS connections remain sync
(sub-millisecond, acceptable for tokio).
Required Methods§
Sourcefn query_raw(
&self,
sql: &str,
sql_hash: u64,
params: &[&(dyn Encode + Sync)],
) -> BsqlResult<OwnedResult>
fn query_raw( &self, sql: &str, sql_hash: u64, params: &[&(dyn Encode + Sync)], ) -> BsqlResult<OwnedResult>
Execute a query and return all rows.
Sourcefn query_raw_readonly(
&self,
sql: &str,
sql_hash: u64,
params: &[&(dyn Encode + Sync)],
) -> BsqlResult<OwnedResult>
fn query_raw_readonly( &self, sql: &str, sql_hash: u64, params: &[&(dyn Encode + Sync)], ) -> BsqlResult<OwnedResult>
Execute a read-only query. May route to replicas in the future.
Sourcefn execute_raw(
&self,
sql: &str,
sql_hash: u64,
params: &[&(dyn Encode + Sync)],
) -> BsqlResult<u64>
fn execute_raw( &self, sql: &str, sql_hash: u64, params: &[&(dyn Encode + Sync)], ) -> BsqlResult<u64>
Execute a query and return the number of affected rows.