alopex_sql/ast/
mod.rs

1pub mod ddl;
2pub mod dml;
3pub mod expr;
4pub mod span;
5
6pub use ddl::*;
7pub use dml::*;
8pub use expr::*;
9pub use span::{Location, Span, Spanned};
10
11/// Top-level SQL statement wrapper with span information.
12#[derive(Debug, Clone)]
13pub struct Statement {
14    pub kind: StatementKind,
15    pub span: Span,
16}
17
18impl Spanned for Statement {
19    fn span(&self) -> Span {
20        self.span
21    }
22}
23
24#[derive(Debug, Clone)]
25#[allow(clippy::large_enum_variant)]
26pub enum StatementKind {
27    // DDL
28    CreateTable(CreateTable),
29    DropTable(DropTable),
30    CreateIndex(CreateIndex),
31    DropIndex(DropIndex),
32
33    // DML
34    Select(Select),
35    Insert(Insert),
36    Update(Update),
37    Delete(Delete),
38}