pub struct QueryProcessor { /* private fields */ }Expand description
Processes queries through the full pipeline.
The processor holds references to the stores and provides a unified interface for executing queries in any supported language.
§Example
ⓘ
use grafeo_engine::query::processor::{QueryProcessor, QueryLanguage};
let processor = QueryProcessor::for_lpg(store);
let result = processor.process("MATCH (n:Person) RETURN n", QueryLanguage::Gql, None)?;Implementations§
Source§impl QueryProcessor
impl QueryProcessor
Sourcepub fn for_lpg_with_tx(
store: Arc<LpgStore>,
tx_manager: Arc<TransactionManager>,
) -> Self
pub fn for_lpg_with_tx( store: Arc<LpgStore>, tx_manager: Arc<TransactionManager>, ) -> Self
Creates a new query processor with a transaction manager.
Sourcepub fn with_tx_context(self, viewing_epoch: EpochId, tx_id: TxId) -> Self
pub fn with_tx_context(self, viewing_epoch: EpochId, tx_id: TxId) -> Self
Sets the transaction context for MVCC visibility.
This should be called when the processor is used within a transaction.
Sourcepub fn with_catalog(self, catalog: Arc<Catalog>) -> Self
pub fn with_catalog(self, catalog: Arc<Catalog>) -> Self
Sets a custom catalog.
Sourcepub fn with_optimizer(self, optimizer: Optimizer) -> Self
pub fn with_optimizer(self, optimizer: Optimizer) -> Self
Sets a custom optimizer.
Sourcepub fn process(
&self,
query: &str,
language: QueryLanguage,
params: Option<&QueryParams>,
) -> Result<QueryResult>
pub fn process( &self, query: &str, language: QueryLanguage, params: Option<&QueryParams>, ) -> Result<QueryResult>
Processes a query string and returns results.
Pipeline:
- Parse (language-specific parser → AST)
- Translate (AST → LogicalPlan)
- Bind (semantic validation)
- Optimize (filter pushdown, join reorder, etc.)
- Plan (logical → physical operators)
- Execute (run operators, collect results)
§Arguments
query- The query stringlanguage- Which query language to useparams- Optional query parameters for prepared statements
§Errors
Returns an error if any stage of the pipeline fails.
Source§impl QueryProcessor
impl QueryProcessor
Sourcepub fn tx_manager(&self) -> &Arc<TransactionManager>
pub fn tx_manager(&self) -> &Arc<TransactionManager>
Returns a reference to the transaction manager.
Auto Trait Implementations§
impl Freeze for QueryProcessor
impl !RefUnwindSafe for QueryProcessor
impl Send for QueryProcessor
impl Sync for QueryProcessor
impl Unpin for QueryProcessor
impl !UnwindSafe for QueryProcessor
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more