#[non_exhaustive]pub enum Expr {
Field(String),
Literal(LiteralValue),
FuncCall {
name: String,
args: Vec<Expr>,
},
BinaryOp {
op: ArithmeticOp,
left: Box<Expr>,
right: Box<Expr>,
},
If {
condition: Condition,
then_expr: Box<Expr>,
else_expr: Box<Expr>,
},
Case {
branches: Vec<(Condition, Expr)>,
default: Option<Box<Expr>>,
},
Window {
func: WindowFunc,
over: WindowSpec,
},
}Expand description
Expression used in select clauses and function arguments.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Field(String)
필드 참조: name
Literal(LiteralValue)
리터럴 값: 42, "hello", true
FuncCall
함수 호출: upper(name), round(price, 2), upper(trim(name))
BinaryOp
이항 산술 연산: amount * quantity, first_name + " " + last_name
If
조건 표현식: if(condition, then_expr, else_expr)
Case
CASE 표현식: case when cond1 then expr1 [when cond2 then expr2]* [else expr] end
Window
윈도우 함수: func(...) over (partition by ... order by ...)
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