pub enum Expr {
Show 17 variants
IntegerLiteral(i64),
FloatLiteral(f64),
StringLiteral(String),
BooleanLiteral(bool),
Null,
ColumnRef(String),
FunctionCall {
name: String,
args: Vec<Expr>,
},
Cast {
expr: Box<Expr>,
type_name: String,
},
BinaryOp {
left: Box<Expr>,
op: String,
right: Box<Expr>,
},
UnaryOp {
op: String,
expr: Box<Expr>,
},
IsNull {
expr: Box<Expr>,
negated: bool,
},
InList {
expr: Box<Expr>,
list: Vec<Expr>,
negated: bool,
},
Between {
expr: Box<Expr>,
low: Box<Expr>,
high: Box<Expr>,
negated: bool,
},
Nested(Box<Expr>),
NextVal(String),
CurrentTimestamp,
Raw(String),
}Expand description
An expression node in the IR.
Variants§
IntegerLiteral(i64)
Integer literal (e.g., 42)
FloatLiteral(f64)
Float literal (e.g., 3.14)
StringLiteral(String)
String literal (e.g., 'hello')
BooleanLiteral(bool)
Boolean literal (true/false)
Null
NULL literal
ColumnRef(String)
Column reference (e.g., status)
FunctionCall
Function call (e.g., now(), lower(col))
Cast
Type cast (e.g., value::integer, CAST(value AS integer))
BinaryOp
Binary operation (e.g., a + b, a AND b)
UnaryOp
Unary operation (e.g., NOT a, -x)
IsNull
IS NULL / IS NOT NULL
InList
IN list (e.g., col IN ('a', 'b', 'c'))
Between
BETWEEN (e.g., col BETWEEN 1 AND 10)
Nested(Box<Expr>)
Parenthesized expression
NextVal(String)
nextval(‘sequence_name’) — PG-specific, removed during transform
CurrentTimestamp
CURRENT_TIMESTAMP (SQLite built-in)
Raw(String)
Raw SQL string for expressions that can’t be decomposed further
Implementations§
Trait Implementations§
impl StructuralPartialEq for Expr
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnsafeUnpin for Expr
impl UnwindSafe for Expr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more