pub enum Expr<'bump> {
Show 24 variants
Between {
lhs: &'bump Expr<'bump>,
not: bool,
start: &'bump Expr<'bump>,
end: &'bump Expr<'bump>,
},
Binary(&'bump Expr<'bump>, Operator, &'bump Expr<'bump>),
Case {
base: Option<&'bump Expr<'bump>>,
when_then_pairs: &'bump [(Expr<'bump>, Expr<'bump>)],
else_expr: Option<&'bump Expr<'bump>>,
},
Cast {
expr: &'bump Expr<'bump>,
type_name: Option<Type<'bump>>,
},
Collate(&'bump Expr<'bump>, &'bump str),
DoublyQualified(Name<'bump>, Name<'bump>, Name<'bump>),
Exists(&'bump Select<'bump>),
FunctionCall {
name: Id<'bump>,
distinctness: Option<Distinctness>,
args: Option<&'bump [Expr<'bump>]>,
order_by: Option<FunctionCallOrder<'bump>>,
filter_over: Option<FunctionTail<'bump>>,
},
FunctionCallStar {
name: Id<'bump>,
filter_over: Option<FunctionTail<'bump>>,
},
Id(Id<'bump>),
InList {
lhs: &'bump Expr<'bump>,
not: bool,
rhs: Option<&'bump [Expr<'bump>]>,
},
InSelect {
lhs: &'bump Expr<'bump>,
not: bool,
rhs: &'bump Select<'bump>,
},
InTable {
lhs: &'bump Expr<'bump>,
not: bool,
rhs: QualifiedName<'bump>,
args: Option<&'bump [Expr<'bump>]>,
},
IsNull(&'bump Expr<'bump>),
Like {
lhs: &'bump Expr<'bump>,
not: bool,
op: LikeOperator,
rhs: &'bump Expr<'bump>,
escape: Option<&'bump Expr<'bump>>,
},
Literal(Literal<'bump>),
Name(Name<'bump>),
NotNull(&'bump Expr<'bump>),
Parenthesized(Vec<'bump, Expr<'bump>>),
Qualified(Name<'bump>, Name<'bump>),
Raise(ResolveType, Option<&'bump Expr<'bump>>),
Subquery(&'bump Select<'bump>),
Unary(UnaryOperator, &'bump Expr<'bump>),
Variable(&'bump str),
}Expand description
SQL expression
Variants§
Between
BETWEEN
Fields
Binary(&'bump Expr<'bump>, Operator, &'bump Expr<'bump>)
binary expression
Case
CASE expression
Fields
Cast
CAST expression
Collate(&'bump Expr<'bump>, &'bump str)
COLLATE: expression
DoublyQualified(Name<'bump>, Name<'bump>, Name<'bump>)
schema-name.table-name.column-name
Exists(&'bump Select<'bump>)
EXISTS subquery
FunctionCall
call to a built-in function
Fields
§
distinctness: Option<Distinctness>DISTINCT
§
order_by: Option<FunctionCallOrder<'bump>>ORDER BY or WITHIN GROUP
§
filter_over: Option<FunctionTail<'bump>>FILTER
FunctionCallStar
Function call expression with ‘*’ as arg
Id(Id<'bump>)
Identifier
InList
IN
InSelect
IN subselect
InTable
IN table name / function
Fields
§
rhs: QualifiedName<'bump>table name
IsNull(&'bump Expr<'bump>)
IS NULL
Like
LIKE
Fields
§
op: LikeOperatoroperator
Literal(Literal<'bump>)
Literal expression
Name(Name<'bump>)
Name
NotNull(&'bump Expr<'bump>)
NOT NULL or NOTNULL
Parenthesized(Vec<'bump, Expr<'bump>>)
Parenthesized subexpression
Qualified(Name<'bump>, Name<'bump>)
Qualified name
Raise(ResolveType, Option<&'bump Expr<'bump>>)
RAISE function call
Subquery(&'bump Select<'bump>)
Subquery expression
Unary(UnaryOperator, &'bump Expr<'bump>)
Unary expression
Variable(&'bump str)
Parameters
Implementations§
Source§impl<'bump> Expr<'bump>
impl<'bump> Expr<'bump>
Sourcepub fn parenthesized(x: Self, b: &'bump Bump) -> Self
pub fn parenthesized(x: Self, b: &'bump Bump) -> Self
Constructor
Sourcepub fn like(
lhs: Self,
not: bool,
op: LikeOperator,
rhs: Self,
escape: Option<Self>,
b: &'bump Bump,
) -> Self
pub fn like( lhs: Self, not: bool, op: LikeOperator, rhs: Self, escape: Option<Self>, b: &'bump Bump, ) -> Self
Constructor
Sourcepub fn unary(op: UnaryOperator, x: Self, b: &'bump Bump) -> Self
pub fn unary(op: UnaryOperator, x: Self, b: &'bump Bump) -> Self
Constructor
Sourcepub fn between(
lhs: Self,
not: bool,
start: Self,
end: Self,
b: &'bump Bump,
) -> Self
pub fn between( lhs: Self, not: bool, start: Self, end: Self, b: &'bump Bump, ) -> Self
Constructor
Sourcepub fn in_list(
lhs: Self,
not: bool,
rhs: Option<Vec<'bump, Self>>,
b: &'bump Bump,
) -> Self
pub fn in_list( lhs: Self, not: bool, rhs: Option<Vec<'bump, Self>>, b: &'bump Bump, ) -> Self
Constructor
Sourcepub fn in_select(
lhs: Self,
not: bool,
rhs: Select<'bump>,
b: &'bump Bump,
) -> Self
pub fn in_select( lhs: Self, not: bool, rhs: Select<'bump>, b: &'bump Bump, ) -> Self
Constructor
Sourcepub fn in_table(
lhs: Self,
not: bool,
rhs: QualifiedName<'bump>,
args: Option<Vec<'bump, Self>>,
b: &'bump Bump,
) -> Self
pub fn in_table( lhs: Self, not: bool, rhs: QualifiedName<'bump>, args: Option<Vec<'bump, Self>>, b: &'bump Bump, ) -> Self
Constructor
Sourcepub fn function_call(
xt: u16,
x: Token<'_>,
distinctness: Option<Distinctness>,
args: Option<Vec<'bump, Self>>,
order_by: Option<FunctionCallOrder<'bump>>,
filter_over: Option<FunctionTail<'bump>>,
b: &'bump Bump,
) -> Result<Self, ParserError>
pub fn function_call( xt: u16, x: Token<'_>, distinctness: Option<Distinctness>, args: Option<Vec<'bump, Self>>, order_by: Option<FunctionCallOrder<'bump>>, filter_over: Option<FunctionTail<'bump>>, b: &'bump Bump, ) -> Result<Self, ParserError>
Constructor
Sourcepub fn is_integer(&self) -> Option<i64>
pub fn is_integer(&self) -> Option<i64>
Check if an expression is an integer
Trait Implementations§
impl<'bump> Eq for Expr<'bump>
Source§impl<'bump> PartialEq for Expr<'bump>
impl<'bump> PartialEq for Expr<'bump>
impl<'bump> StructuralPartialEq for Expr<'bump>
Auto Trait Implementations§
impl<'bump> !RefUnwindSafe for Expr<'bump>
impl<'bump> !Send for Expr<'bump>
impl<'bump> !Sync for Expr<'bump>
impl<'bump> !UnwindSafe for Expr<'bump>
impl<'bump> Freeze for Expr<'bump>
impl<'bump> Unpin for Expr<'bump>
impl<'bump> UnsafeUnpin for Expr<'bump>
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
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
Compare self to
key and return true if they are equal.