pub trait SqlStore<Op, Event: RoutableEvent>: Store<Op, ProcessorError<BoxError>, Event> {
// Required methods
fn query<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
sql: &'life1 str,
params: &'life2 [DbValue],
) -> Pin<Box<dyn Future<Output = Result<Vec<DbRow>, DbError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn dialect(&self) -> SqlDialect;
}Expand description
A Store backed by SQL, adding ad-hoc reads.
The inherited Store surface (exec) always
errors as the SQL engine’s ProcessorError<BoxError>, so it’s pinned in the
supertrait bound rather than left as a parameter. query
reports its own DbError instead.
Required Methods§
Sourcefn query<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
sql: &'life1 str,
params: &'life2 [DbValue],
) -> Pin<Box<dyn Future<Output = Result<Vec<DbRow>, DbError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn query<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
sql: &'life1 str,
params: &'life2 [DbValue],
) -> Pin<Box<dyn Future<Output = Result<Vec<DbRow>, DbError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Run a read-only query against the backend.
Sourcefn dialect(&self) -> SqlDialect
fn dialect(&self) -> SqlDialect
The backend’s SQL dialect — lets a caller build dialect-correct SQL
(placeholder style, quoting) to hand back to query.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".