Skip to main content

nodedb_sql/ddl_ast/statement/
wrapper.rs

1// SPDX-License-Identifier: Apache-2.0
2
3//! The [`NodedbStatement`] enum — one variant per DDL topic area.
4//!
5//! Each variant wraps a topic-specific sub-enum defined in
6//! `statement/types/`. This file only declares the top-level wrapper.
7
8use super::types::{
9    AuthStmt, AutomationStmt, ClusterStmt, CollectionStmt, DatabaseStmt, GraphStmt, MiscStmt,
10    PolicyStmt, StreamViewStmt,
11};
12
13/// Typed representation of every NodeDB DDL statement.
14///
15/// Handlers receive a fully-parsed variant instead of raw `&[&str]`
16/// parts, eliminating array-index panics and enabling exhaustive
17/// match coverage for new DDL commands.
18#[derive(Debug, Clone, PartialEq)]
19pub enum NodedbStatement {
20    Collection(CollectionStmt),
21    Automation(AutomationStmt),
22    StreamView(StreamViewStmt),
23    Policy(PolicyStmt),
24    Database(DatabaseStmt),
25    Cluster(ClusterStmt),
26    Auth(AuthStmt),
27    Graph(GraphStmt),
28    Misc(MiscStmt),
29}