Skip to main content

Module query_context

Module query_context 

Source
Expand description

Query context

Manage the context information throughout the entire lifecycle of queries, from parsing and validation to planning and execution.

§Creation

Use QueryContext::new for simple cases or QueryContext::builder for complex configuration:

ⓘ
use linkrs::query::context::{QueryContext, QueryRequestContext};
use std::sync::Arc;

// Simple creation
let rctx = Arc::new(QueryRequestContext::new("MATCH (n) RETURN n".to_string()));
let ctx = QueryContext::new(rctx);

// With builder (for complex configuration)
let ctx = QueryContext::builder(rctx)
    .with_space_info(space_info)
    .with_arena()
    .build();

§Arena Allocation

For high-performance query execution with many temporary allocations, enable arena allocation via the builder’s with_arena() method. This is beneficial for:

  • Complex queries with many intermediate results
  • Expression evaluation with temporary values
  • Graph traversal with path accumulation

Structs§

QueryContext
Query context