Skip to main content

nodedb_sql/ddl_ast/
mod.rs

1// SPDX-License-Identifier: Apache-2.0
2
3//! Typed AST for NodeDB-specific DDL statements.
4//!
5//! Every DDL command the system supports is represented as a variant
6//! of [`NodedbStatement`]. The DDL router matches on this enum
7//! instead of string prefixes, so the compiler catches missing
8//! handlers when a new DDL is added.
9//!
10//! The parser ([`parse`]) converts raw SQL into a `NodedbStatement`.
11//! Each statement parser reads literal-aware tokens left to right: a
12//! keyword matches only at its clause position, never inside a string
13//! literal or quoted identifier, and an unread token is a parse error.
14
15pub mod alter_ops;
16pub mod collection_type;
17pub mod graph_parse;
18pub mod graph_types;
19pub mod parse;
20pub mod statement;
21
22pub use alter_ops::{
23    AlterCollectionOp, AlterRoleOp, AlterUserOp, ConflictPolicyKind, ConstraintKindKeyword,
24};
25pub use collection_type::build_collection_type;
26pub use graph_parse::{FusionParams, parse_search_using_fusion};
27pub use graph_types::{GraphDirection, GraphProperties};
28pub use nodedb_types::QuotaSpec;
29pub use nodedb_types::{MirrorMode, MirrorStatus};
30pub use parse::parse;
31pub use statement::{
32    AlterDatabaseOperation, AlterTenantOperation, AuthStmt, AutomationStmt, CloneAsOf, ClusterStmt,
33    CollectionStmt, DatabaseStmt, GraphStmt, MiscStmt, NodedbStatement, OidcClaimMappingClause,
34    PolicyStmt, StreamViewStmt, TenantSelector,
35};