nodedb_sql/ddl_ast/graph_parse/mod.rs
1// SPDX-License-Identifier: Apache-2.0
2
3//! Typed parsing for the graph DSL (`GRAPH ...`, `MATCH ...`).
4//!
5//! A quote-, brace- and bracket-aware tokeniser feeds one parser per
6//! statement. Each parser reads its clauses left to right and produces a
7//! typed [`NodedbStatement`]. A token that is not a clause of the statement
8//! is a parse error, so a misspelled clause keyword never runs the
9//! statement with a default. Every graph DSL command flows through here
10//! before reaching a handler, so the handlers never touch raw SQL.
11//!
12//! Numeric *ranges* and engine-level caps stay unvalidated here and are
13//! enforced at the pgwire boundary, which keeps this module free of
14//! `pgwire` dependencies and out of the `nodedb` → `nodedb-sql` edge.
15//!
16//! Structure is validated here, because the boundary cannot see it: a
17//! required clause that is absent, or a clause value outside its own
18//! vocabulary, means no statement reaches the boundary at all. Both are
19//! reported as a parse error naming what is wrong.
20
21mod cursor;
22mod edge_predicate;
23mod entry;
24pub mod fusion_params;
25mod tokenizer;
26mod variants;
27
28pub use entry::try_parse;
29pub use fusion_params::{
30 FusionKeywords, FusionParams, RAG_FUSION_KEYWORDS, SEARCH_FUSION_KEYWORDS,
31 parse_search_using_fusion,
32};