mod ddl;
mod dml;
mod tcl;
pub use crate::ast::ddl::*;
pub use crate::ast::dml::*;
pub use crate::ast::tcl::*;
#[derive(Clone, Debug, PartialEq)]
pub enum Stmt {
Select(Select),
Insert(Insert),
Update(Update),
Delete(Delete),
CreateTable(CreateTable),
CreateIndex(CreateIndex),
CreateView(CreateView),
CreateTrigger(CreateTrigger),
AlterTable(AlterTable),
DropTable(DropTable),
DropIndex(DropIndex),
DropView(DropView),
DropTrigger(DropTrigger),
Begin(Begin),
Commit(Commit),
Rollback(Rollback),
Savepoint(Savepoint),
Release(Release),
}
#[derive(Clone, Debug, PartialEq)]
pub enum Literal {
Integer(u64), Float(f64), String(String), Blob(String), Null, Bool(bool), CurrentTime, CurrentDate, CurrentTimestamp, }
#[derive(Clone, Debug, PartialEq)]
pub enum Expr {
Literal(Literal), ExprList(Vec<Expr>), Unary(UnaryOp, Box<Expr>), Binary(Box<Expr>, BinaryOp, Box<Expr>), QualifiedColumn(Option<String>, Option<String>, String), NullJudge(Box<Expr>, bool),
Between {
expr: Box<Expr>,
not: bool,
low: Box<Expr>,
high: Box<Expr>,
}, In {
expr: Box<Expr>,
not: bool,
list: Vec<Expr>,
}, Match {
expr: Box<Expr>,
not: bool,
pattern: Box<Expr>,
}, Like {
expr: Box<Expr>,
not: bool,
pattern: Box<Expr>,
escape: Option<Box<Expr>>,
}, Regexp {
expr: Box<Expr>,
not: bool,
pattern: Box<Expr>,
}, Glob {
expr: Box<Expr>,
not: bool,
pattern: Box<Expr>,
}, }
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum BinaryOp {
Concat,
Mul, Div, Mod,
Plus, Minus,
BitwiseAnd, BitwiseOr, RightShift, LeftShift,
Lt, Le, Gt, Ge,
Eq, Ne, Is, IsNot,
LogicalAnd, LogicalOr, }
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum UnaryOp {
BitwiseNot, Positive, Negative, LogicalNot, }
#[derive(Clone, Debug, PartialEq)]
pub struct SchemaObject {
pub schema_name: Option<String>,
pub name: String,
}
#[derive(Clone, Debug, PartialEq)]
pub enum ConflictResolution {
Abort,
Fail,
Ignore,
Replace,
Rollback,
}