cypher_rs_zk/lib.rs
1//! `cypher-rs` - openCypher front-end in Rust.
2//!
3//! Pre-v0. Parses a subset of openCypher including read clauses (`MATCH`,
4//! `LOAD CSV`, `WHERE`, `RETURN`, `WITH`, ordering and pagination) and update
5//! clauses (`CREATE`, `CREATE UNIQUE`, `MERGE`, `SET`, `REMOVE`, `DELETE`,
6//! `UNWIND`, `FOREACH`), legacy `START` lookups,
7//! the `EXPLAIN`, `PROFILE`, `CYPHER`, and `USING PERIODIC COMMIT` query
8//! options, index and constraint schema commands, plus common expressions.
9//! Semantic analysis includes conservative expression type inference and
10//! statically-known operand and clause-context validation, with optional
11//! schema metadata for variables, properties, parameters, and functions.
12//!
13//! ```
14//! use cypher_rs_zk::parse;
15//! let q = parse("MATCH (u:User) WHERE u.id = $uid RETURN u.name").unwrap();
16//! assert_eq!(q.clauses.len(), 3);
17//! ```
18//!
19//! Roadmap and scope: see the project README.
20
21pub mod ast;
22pub mod cost;
23pub mod error;
24pub mod optimize;
25mod parser;
26pub mod plan;
27pub mod prune;
28pub mod sema;
29
30#[cfg(feature = "mcp")]
31pub mod mcp;
32
33pub use ast::*;
34pub use cost::{estimate, estimate_cost, CardinalityCostModel, CostModel, Estimate};
35pub use error::ParseError;
36pub use optimize::optimize;
37pub use parser::parse;
38pub use plan::{plan, Plan, PlanError, ProjectExpr, SortKey};
39pub use prune::{output_columns, required_input_columns};
40pub use sema::{
41 analyze, analyze_with, infer_expression_type, infer_expression_type_with, AnalysisReport,
42 CypherType, FunctionSignature, PermissiveSchema, Schema, SemIssue, SemSeverity,
43};