pub enum Expr {
Show 19 variants
Literal(Literal),
Parameter {
index: u32,
name: Option<NameId>,
},
Column {
database: Option<NameId>,
table: Option<NameId>,
column: NameId,
},
Star {
table: Option<NameId>,
},
Unary {
op: UnaryOp,
operand: ExprId,
},
Binary {
op: BinaryOp,
left: ExprId,
right: ExprId,
},
Collate {
operand: ExprId,
collation: NameId,
},
Cast {
operand: ExprId,
declared: NameId,
},
Pattern {
negated: bool,
op: PatternOp,
operand: ExprId,
pattern: ExprId,
escape: Option<ExprId>,
},
Between {
negated: bool,
operand: ExprId,
low: ExprId,
high: ExprId,
},
In {
negated: bool,
operand: ExprId,
rhs: InRhs,
},
IsNull {
negated: bool,
operand: ExprId,
},
Is {
negated: bool,
distinct_from: bool,
left: ExprId,
right: ExprId,
},
Case {
operand: Option<ExprId>,
branches: Vec<(ExprId, ExprId)>,
otherwise: Option<ExprId>,
},
Function {
name: NameId,
distinct: bool,
arguments: Option<Vec<ExprId>>,
order_by: Vec<OrderTerm>,
filter: Option<ExprId>,
over: Option<WindowId>,
},
Exists {
negated: bool,
select: SelectId,
},
Subquery(SelectId),
RowValue(Vec<ExprId>),
Raise {
action: RaiseAction,
message: Option<ExprId>,
},
}Expand description
An expression, in the shape it was written.
Variants§
Literal(Literal)
A literal.
Parameter
A bound parameter.
Fields
Column
A column reference, with as much qualification as was written.
Fields
Star
* or table.*, legal only where the grammar allows it.
Unary
A unary operator applied to one operand.
Binary
A binary operator applied to two operands.
Collate
expr COLLATE name.
Cast
CAST(expr AS type).
Pattern
expr [NOT] LIKE|GLOB|REGEXP|MATCH pattern [ESCAPE expr].
Fields
Between
expr [NOT] BETWEEN low AND high.
Fields
In
expr [NOT] IN rhs.
Fields
IsNull
expr ISNULL / expr NOTNULL / expr IS [NOT] NULL.
Is
left IS [NOT] [DISTINCT FROM] right.
Fields
Case
CASE [operand] WHEN ... THEN ... [ELSE ...] END.
Fields
Function
A function call, aggregate or scalar or window.
Fields
Exists
[NOT] EXISTS (SELECT ...).
Subquery(SelectId)
A scalar subquery.
RowValue(Vec<ExprId>)
A parenthesised list of two or more expressions.
Raise
RAISE(...), legal only inside a trigger body.
Fields
action: RaiseActionWhich action.
message: Option<ExprId>The message, when the action takes one.
An expression, as SQLite takes it: RAISE(ABORT, 'too big: ' || NEW.n) names the value that broke the rule, which is the reason to
write a guard trigger at all. It used to be a string literal only,
and anything else was a syntax error pointing at the ||.