pub struct QueryEngine { /* private fields */ }Expand description
Query engine for executing SQL against a projection store.
The engine is stateless and can be shared across threads. It holds only the schema definition.
Implementations§
Source§impl QueryEngine
impl QueryEngine
Sourcepub fn query<S: ProjectionStore>(
&self,
store: &mut S,
sql: &str,
params: &[Value],
) -> Result<QueryResult>
pub fn query<S: ProjectionStore>( &self, store: &mut S, sql: &str, params: &[Value], ) -> Result<QueryResult>
Sourcepub fn query_at<S: ProjectionStore>(
&self,
store: &mut S,
sql: &str,
params: &[Value],
position: Offset,
) -> Result<QueryResult>
pub fn query_at<S: ProjectionStore>( &self, store: &mut S, sql: &str, params: &[Value], position: Offset, ) -> Result<QueryResult>
Executes a SQL query at a specific log position (point-in-time query).
This enables compliance queries that show the state as it was at a specific point in the log.
§Arguments
store- The projection store to querysql- SQL query stringparams- Query parametersposition- Log position to query at
§Example
ⓘ
// Get user state as of log position 1000
let result = engine.query_at(
&mut store,
"SELECT * FROM users WHERE id = 1",
&[],
Offset::new(1000),
)?;Trait Implementations§
Source§impl Clone for QueryEngine
impl Clone for QueryEngine
Source§fn clone(&self) -> QueryEngine
fn clone(&self) -> QueryEngine
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for QueryEngine
impl RefUnwindSafe for QueryEngine
impl Send for QueryEngine
impl Sync for QueryEngine
impl Unpin for QueryEngine
impl UnwindSafe for QueryEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more