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§
Sourcefn query_raw(
&self,
sql: &str,
sql_hash: u64,
params: &[&(dyn Encode + Sync)],
) -> impl Future<Output = BsqlResult<OwnedResult>> + Send
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.
Sourcefn query_raw_readonly(
&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
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)],
) -> impl Future<Output = BsqlResult<u64>> + Send
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.