pub enum Expr {
Show 14 variants
Literal(Literal),
Column {
table: Option<String>,
name: String,
span: Span,
},
Binary {
left: Box<Expr>,
op: BinaryOp,
right: Box<Expr>,
},
Unary {
op: UnaryOp,
operand: Box<Expr>,
},
Function(FunctionCall),
Subquery(Box<SelectStatement>),
IsNull {
expr: Box<Expr>,
negated: bool,
},
In {
expr: Box<Expr>,
list: Vec<Expr>,
negated: bool,
},
Between {
expr: Box<Expr>,
low: Box<Expr>,
high: Box<Expr>,
negated: bool,
},
Case {
operand: Option<Box<Expr>>,
when_clauses: Vec<(Expr, Expr)>,
else_clause: Option<Box<Expr>>,
},
Cast {
expr: Box<Expr>,
data_type: DataType,
},
Paren(Box<Expr>),
Parameter {
name: Option<String>,
position: usize,
},
Wildcard {
table: Option<String>,
},
}Expand description
An SQL expression.
Variants§
Literal(Literal)
A literal value.
Column
A column reference (optionally qualified with table name).
Fields
Binary
A binary expression.
Unary
A unary expression.
Function(FunctionCall)
A function call.
Subquery(Box<SelectStatement>)
A subquery.
IsNull
IS NULL expression.
In
IN expression.
Fields
Between
BETWEEN expression.
Fields
Case
CASE expression.
Fields
Cast
CAST expression.
Paren(Box<Expr>)
Parenthesized expression.
Parameter
A parameter placeholder (? or :name).
Fields
Wildcard
Wildcard (*) in SELECT.
Implementations§
Source§impl Expr
impl Expr
Sourcepub fn qualified_column(
table: impl Into<String>,
name: impl Into<String>,
) -> Self
pub fn qualified_column( table: impl Into<String>, name: impl Into<String>, ) -> Self
Creates a new qualified column reference.
Sourcepub fn is_not_null(self) -> Self
pub fn is_not_null(self) -> Self
Creates an IS NOT NULL expression.
Sourcepub fn not_between(self, low: Self, high: Self) -> Self
pub fn not_between(self, low: Self, high: Self) -> Self
Creates a NOT BETWEEN expression.
Sourcepub fn not_in_list(self, list: Vec<Self>) -> Self
pub fn not_in_list(self, list: Vec<Self>) -> Self
Creates a NOT IN expression.
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 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