Skip to main content

grafeo_engine/query/
mod.rs

1//! The complete query processing pipeline.
2//!
3//! Your query goes through several stages before results come back:
4//!
5//! 1. **Translator** - Parses GQL/Cypher/SPARQL into a logical plan
6//! 2. **Binder** - Validates that variables and properties exist
7//! 3. **Optimizer** - Pushes filters down, reorders joins for speed
8//! 4. **Planner** - Converts the logical plan to physical operators
9//! 5. **Executor** - Actually runs the operators and streams results
10//!
11//! Most users don't interact with these directly - just call
12//! [`Session::execute()`](crate::Session::execute). But if you're building
13//! custom query processing, [`QueryProcessor`] is the unified interface.
14
15pub mod binder;
16pub mod cache;
17pub mod executor;
18pub mod optimizer;
19pub mod plan;
20pub mod planner;
21pub mod processor;
22
23#[cfg(feature = "rdf")]
24pub mod planner_rdf;
25
26#[cfg(feature = "gql")]
27pub mod gql_translator;
28
29#[cfg(feature = "cypher")]
30pub mod cypher_translator;
31
32#[cfg(feature = "sparql")]
33pub mod sparql_translator;
34
35#[cfg(feature = "gremlin")]
36pub mod gremlin_translator;
37
38#[cfg(feature = "graphql")]
39pub mod graphql_translator;
40
41#[cfg(feature = "sql-pgq")]
42pub mod sql_pgq_translator;
43
44#[cfg(all(feature = "graphql", feature = "rdf"))]
45pub mod graphql_rdf_translator;
46
47// Core exports
48pub use cache::{CacheKey, CacheStats, CachingQueryProcessor, QueryCache};
49pub use executor::Executor;
50pub use optimizer::{CardinalityEstimator, Optimizer};
51pub use plan::{LogicalExpression, LogicalOperator, LogicalPlan};
52pub use planner::{
53    PhysicalPlan, Planner, convert_aggregate_function, convert_binary_op,
54    convert_filter_expression, convert_unary_op,
55};
56pub use processor::{QueryLanguage, QueryParams, QueryProcessor};
57
58#[cfg(feature = "rdf")]
59pub use planner_rdf::RdfPlanner;
60
61// Translator exports
62#[cfg(feature = "gql")]
63pub use gql_translator::translate as translate_gql;
64
65#[cfg(feature = "cypher")]
66pub use cypher_translator::translate as translate_cypher;
67
68#[cfg(feature = "sparql")]
69pub use sparql_translator::translate as translate_sparql;
70
71#[cfg(feature = "gremlin")]
72pub use gremlin_translator::translate as translate_gremlin;
73
74#[cfg(feature = "graphql")]
75pub use graphql_translator::translate as translate_graphql;
76
77#[cfg(feature = "sql-pgq")]
78pub use sql_pgq_translator::translate as translate_sql_pgq;
79
80#[cfg(all(feature = "graphql", feature = "rdf"))]
81pub use graphql_rdf_translator::translate as translate_graphql_rdf;