MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / execute_basic_query

Method execute_basic_query

graphlite/src/exec/executor.rs:975–1007  ·  view source on GitHub ↗

ROADMAP v0.5.0 - Alternative simplified query execution path

(
        &self,
        basic_query: &BasicQuery,
        graph_expr: Option<&GraphExpression>,
        context: &mut ExecutionContext,
    )

Source from the content-addressed store, hash-verified

973 /// Execute a basic query by converting it to a physical plan
974 #[allow(dead_code)] // ROADMAP v0.5.0 - Alternative simplified query execution path
975 fn execute_basic_query(
976 &self,
977 basic_query: &BasicQuery,
978 graph_expr: Option<&GraphExpression>,
979 context: &mut ExecutionContext,
980 ) -> Result<QueryResult, ExecutionError> {
981 use crate::ast::{Document, Query, Statement};
982 use crate::plan::optimizer::QueryPlanner;
983
984 // Resolve graph expression to actual graph
985 let graph = self.resolve_graph_expression(graph_expr)?;
986
987 // Create a Document and Statement wrapper for the planner
988 let query = Query::Basic(basic_query.clone());
989 let statement = Statement::Query(query);
990 let document = Document {
991 statement,
992 location: Location {
993 line: 1,
994 column: 1,
995 offset: 0,
996 },
997 };
998
999 // Use the query planner to create a physical plan
1000 let mut planner = QueryPlanner::new();
1001 let planned_query = planner
1002 .plan_query(&document)
1003 .map_err(|e| ExecutionError::RuntimeError(format!("Planning error: {}", e)))?;
1004
1005 // Execute the physical plan with resolved graph
1006 self.execute_with_graph(&planned_query, &graph, context)
1007 }
1008
1009 /// Execute a basic query with access to outer context variables (for correlated subqueries)
1010 fn execute_basic_query_with_context(

Callers

nothing calls this directly

Calls 5

QueryEnum · 0.85
cloneMethod · 0.80
plan_queryMethod · 0.80
execute_with_graphMethod · 0.80

Tested by

no test coverage detected