pub enum Expr {
Show 27 variants
Between {
lhs: Box<Expr>,
not: bool,
start: Box<Expr>,
end: Box<Expr>,
},
Binary(Box<Expr>, Operator, Box<Expr>),
Case {
base: Option<Box<Expr>>,
when_then_pairs: Vec<(Expr, Expr)>,
else_expr: Option<Box<Expr>>,
},
Cast {
expr: Box<Expr>,
type_name: Option<Type>,
},
Collate(Box<Expr>, String),
DoublyQualified(Name, Name, Name),
Exists(Box<Select>),
FunctionCall {
name: Id,
distinctness: Option<Distinctness>,
args: Option<Vec<Expr>>,
order_by: Option<Vec<SortedColumn>>,
filter_over: Option<FunctionTail>,
},
FunctionCallStar {
name: Id,
filter_over: Option<FunctionTail>,
},
Id(Id),
Column {
database: Option<usize>,
table: TableReferenceId,
column: usize,
is_rowid_alias: bool,
},
RowId {
database: Option<usize>,
table: TableReferenceId,
},
InList {
lhs: Box<Expr>,
not: bool,
rhs: Option<Vec<Expr>>,
},
InSelect {
lhs: Box<Expr>,
not: bool,
rhs: Box<Select>,
},
InTable {
lhs: Box<Expr>,
not: bool,
rhs: QualifiedName,
args: Option<Vec<Expr>>,
},
IsNull(Box<Expr>),
Like {
lhs: Box<Expr>,
not: bool,
op: LikeOperator,
rhs: Box<Expr>,
escape: Option<Box<Expr>>,
},
Literal(Literal),
Name(Name),
NotNull(Box<Expr>),
Parenthesized(Vec<Expr>),
Qualified(Name, Name),
Raise(ResolveType, Option<Box<Expr>>),
Register(usize),
Subquery(Box<Select>),
Unary(UnaryOperator, Box<Expr>),
Variable(String),
}Expand description
SQL expression
Variants§
Between
BETWEEN
Binary(Box<Expr>, Operator, Box<Expr>)
binary expression
Case
CASE expression
Fields
Cast
CAST expression
Collate(Box<Expr>, String)
COLLATE: expression
DoublyQualified(Name, Name, Name)
schema-name.table-name.column-name
Exists(Box<Select>)
EXISTS subquery
FunctionCall
call to a built-in function
Fields
distinctness: Option<Distinctness>DISTINCT
order_by: Option<Vec<SortedColumn>>ORDER BY
filter_over: Option<FunctionTail>FILTER
FunctionCallStar
Function call expression with ‘*’ as arg
Id(Id)
Identifier
Column
Column
Fields
table: TableReferenceIdthe y in x.y.z. index of the table in catalog.
RowId
ROWID
Fields
table: TableReferenceIdthe y in x.y.z. index of the table in catalog.
InList
IN
InSelect
IN subselect
InTable
IN table name / function
Fields
rhs: QualifiedNametable name
IsNull(Box<Expr>)
IS NULL
Like
LIKE
Fields
op: LikeOperatoroperator
Literal(Literal)
Literal expression
Name(Name)
Name
NotNull(Box<Expr>)
NOT NULL or NOTNULL
Parenthesized(Vec<Expr>)
Parenthesized subexpression
Qualified(Name, Name)
Qualified name
Raise(ResolveType, Option<Box<Expr>>)
RAISE function call
Register(usize)
A value that already lives in a VDBE register.
Never produced by the parser — the grammar has no syntax for it. It is
created by the code generator when an expression tree has to reference a
value that was computed earlier in the same program, most notably the
OLD.<col> / NEW.<col> row images of a CREATE TRIGGER body (see
oxisqlite_core::translate::trigger). Rewriting those references into
Register before the body statement is translated means every existing
planner/optimizer/emitter path handles them for free, with no special
“am I inside a trigger?” plumbing threaded through the query planner.
Subquery(Box<Select>)
Subquery expression
Unary(UnaryOperator, Box<Expr>)
Unary expression
Variable(String)
Parameters
Implementations§
Source§impl Expr
impl Expr
Sourcepub fn parenthesized(x: Self) -> Self
pub fn parenthesized(x: Self) -> Self
Constructor
Sourcepub fn like(
lhs: Self,
not: bool,
op: LikeOperator,
rhs: Self,
escape: Option<Self>,
) -> Self
pub fn like( lhs: Self, not: bool, op: LikeOperator, rhs: Self, escape: Option<Self>, ) -> Self
Constructor
Sourcepub fn unary(op: UnaryOperator, x: Self) -> Self
pub fn unary(op: UnaryOperator, x: Self) -> Self
Constructor
Trait Implementations§
impl Eq for Expr
impl StructuralPartialEq for Expr
Source§impl ToSqlString for Expr
impl ToSqlString for Expr
Source§fn to_sql_string<C: ToSqlContext>(&self, context: &C) -> String
fn to_sql_string<C: ToSqlContext>(&self, context: &C) -> String
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.