35 lines
643 B
Rust
35 lines
643 B
Rust
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||
|
|
pub struct Select {
|
||
|
|
pub projection: Vec<SelectItem>,
|
||
|
|
pub from: String,
|
||
|
|
pub selection: Option<Expr>,
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||
|
|
pub enum SelectItem {
|
||
|
|
Wildcard,
|
||
|
|
Expr { expr: Expr, alias: Option<String> },
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||
|
|
pub enum Expr {
|
||
|
|
Identifier(String),
|
||
|
|
Literal(Literal),
|
||
|
|
Binary {
|
||
|
|
left: Box<Expr>,
|
||
|
|
op: BinaryOp,
|
||
|
|
right: Box<Expr>,
|
||
|
|
},
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||
|
|
pub enum Literal {
|
||
|
|
String(String),
|
||
|
|
Null,
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||
|
|
pub enum BinaryOp {
|
||
|
|
Eq,
|
||
|
|
}
|