pub struct ExecutionContext { /* private fields */ }Expand description
Execution context for a query.
The context provides access to:
- Query parameters (bound values for placeholders)
- Cancellation support
- Execution statistics
- Runtime configuration
- Graph storage access (for graph traversal queries)
- Vector index access (optional)
- Collection vector storage access (for named vectors)
Implementations§
Source§impl ExecutionContext
impl ExecutionContext
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new execution context without graph storage.
Use with_graph to add graph storage access.
Sourcepub fn with_parameters(parameters: HashMap<u32, Value>) -> Self
pub fn with_parameters(parameters: HashMap<u32, Value>) -> Self
Creates a context with parameters.
Sourcepub fn with_graph(self, graph: Arc<dyn GraphAccessor>) -> Self
pub fn with_graph(self, graph: Arc<dyn GraphAccessor>) -> Self
Sets the graph accessor for graph traversal operations.
This enables the query executor to perform actual graph traversals using the underlying storage.
Sourcepub fn graph(&self) -> &dyn GraphAccessor
pub fn graph(&self) -> &dyn GraphAccessor
Returns a reference to the graph accessor.
Sourcepub fn graph_arc(&self) -> Arc<dyn GraphAccessor>
pub fn graph_arc(&self) -> Arc<dyn GraphAccessor>
Returns the graph accessor as an Arc.
Sourcepub fn with_vector_index_provider(
self,
provider: Arc<dyn VectorIndexProvider>,
) -> Self
pub fn with_vector_index_provider( self, provider: Arc<dyn VectorIndexProvider>, ) -> Self
Creates a context with a vector index provider.
Sourcepub fn set_vector_index_provider(
&mut self,
provider: Arc<dyn VectorIndexProvider>,
)
pub fn set_vector_index_provider( &mut self, provider: Arc<dyn VectorIndexProvider>, )
Sets the vector index provider.
Sourcepub fn vector_index_provider(&self) -> Option<&dyn VectorIndexProvider>
pub fn vector_index_provider(&self) -> Option<&dyn VectorIndexProvider>
Returns a reference to the vector index provider if one is set.
Sourcepub fn vector_index_provider_arc(&self) -> Option<Arc<dyn VectorIndexProvider>>
pub fn vector_index_provider_arc(&self) -> Option<Arc<dyn VectorIndexProvider>>
Returns a clone of the vector index provider Arc if one is set.
This is useful for operators that need to hold onto the provider for the duration of their execution.
Sourcepub fn with_collection_vector_provider(
self,
provider: Arc<dyn CollectionVectorProvider>,
) -> Self
pub fn with_collection_vector_provider( self, provider: Arc<dyn CollectionVectorProvider>, ) -> Self
Sets the collection vector provider for named vector storage.
Sourcepub fn set_collection_vector_provider(
&mut self,
provider: Arc<dyn CollectionVectorProvider>,
)
pub fn set_collection_vector_provider( &mut self, provider: Arc<dyn CollectionVectorProvider>, )
Sets the collection vector provider.
Sourcepub fn collection_vector_provider(
&self,
) -> Option<&dyn CollectionVectorProvider>
pub fn collection_vector_provider( &self, ) -> Option<&dyn CollectionVectorProvider>
Returns a reference to the collection vector provider if one is set.
Sourcepub fn collection_vector_provider_arc(
&self,
) -> Option<Arc<dyn CollectionVectorProvider>>
pub fn collection_vector_provider_arc( &self, ) -> Option<Arc<dyn CollectionVectorProvider>>
Returns a clone of the collection vector provider Arc if one is set.
Sourcepub fn set_parameter(&mut self, index: u32, value: Value)
pub fn set_parameter(&mut self, index: u32, value: Value)
Adds a parameter value.
Sourcepub fn get_parameter(&self, index: u32) -> Option<&Value>
pub fn get_parameter(&self, index: u32) -> Option<&Value>
Gets a parameter value.
Sourcepub fn parameters(&self) -> &HashMap<u32, Value>
pub fn parameters(&self) -> &HashMap<u32, Value>
Returns all parameters.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Checks if the query has been cancelled.
Sourcepub fn config(&self) -> &ExecutionConfig
pub fn config(&self) -> &ExecutionConfig
Returns the configuration.
Sourcepub fn config_mut(&mut self) -> &mut ExecutionConfig
pub fn config_mut(&mut self) -> &mut ExecutionConfig
Returns mutable configuration.
Sourcepub fn record_rows_read(&self, count: u64)
pub fn record_rows_read(&self, count: u64)
Records that rows were read.
Sourcepub fn record_rows_produced(&self, count: u64)
pub fn record_rows_produced(&self, count: u64)
Records that rows were produced.
Sourcepub fn record_rows_filtered(&self, count: u64)
pub fn record_rows_filtered(&self, count: u64)
Records that rows were filtered.
Sourcepub fn with_config(self, config: ExecutionConfig) -> Self
pub fn with_config(self, config: ExecutionConfig) -> Self
Sets the execution configuration.
Sourcepub fn max_rows_in_memory(&self) -> usize
pub fn max_rows_in_memory(&self) -> usize
Returns the maximum rows in memory limit.
Returns 0 if the limit is disabled.