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;
22pub(crate) mod translator_common;
23
24#[cfg(feature = "rdf")]
25pub mod planner_rdf;
26
27#[cfg(feature = "gql")]
28pub mod gql_translator;
29
30#[cfg(feature = "cypher")]
31pub mod cypher_translator;
32
33#[cfg(feature = "sparql")]
34pub mod sparql_translator;
35
36#[cfg(feature = "gremlin")]
37pub mod gremlin_translator;
38
39#[cfg(feature = "graphql")]
40pub mod graphql_translator;
41
42#[cfg(feature = "sql-pgq")]
43pub mod sql_pgq_translator;
44
45#[cfg(all(feature = "graphql", feature = "rdf"))]
46pub mod graphql_rdf_translator;
47
48// Core exports
49pub use cache::{CacheKey, CacheStats, CachingQueryProcessor, QueryCache};
50pub use executor::Executor;
51pub use optimizer::{CardinalityEstimator, Optimizer};
52pub use plan::{LogicalExpression, LogicalOperator, LogicalPlan};
53pub use planner::{
54    PhysicalPlan, Planner, convert_aggregate_function, convert_binary_op,
55    convert_filter_expression, convert_unary_op,
56};
57pub use processor::{QueryLanguage, QueryParams, QueryProcessor};
58
59#[cfg(feature = "rdf")]
60pub use planner_rdf::RdfPlanner;
61
62// Translator exports
63#[cfg(feature = "gql")]
64pub use gql_translator::translate as translate_gql;
65
66#[cfg(feature = "cypher")]
67pub use cypher_translator::translate as translate_cypher;
68
69#[cfg(feature = "sparql")]
70pub use sparql_translator::translate as translate_sparql;
71
72#[cfg(feature = "gremlin")]
73pub use gremlin_translator::translate as translate_gremlin;
74
75#[cfg(feature = "graphql")]
76pub use graphql_translator::translate as translate_graphql;
77
78#[cfg(feature = "sql-pgq")]
79pub use sql_pgq_translator::translate as translate_sql_pgq;
80
81#[cfg(all(feature = "graphql", feature = "rdf"))]
82pub use graphql_rdf_translator::translate as translate_graphql_rdf;