pub trait D1Executor: Send + Sync {
// Required methods
fn execute(&self, sql: &str, params: &[Value]) -> Result<u64, String>;
fn query(&self, sql: &str, params: &[Value]) -> Result<Vec<Value>, String>;
// Provided method
fn query_one(
&self,
sql: &str,
params: &[Value],
) -> Result<Option<Value>, String> { ... }
}Expand description
Executes prepared SQL statements against D1.
Implementations bridge synchronous DataStore calls to D1’s async API
by blocking in the Workers request context (which is single-threaded).