pub enum ExprNode<'a> {
Show 20 variants
Expr(Cow<'a, Expr>),
SqlExpr(Cow<'a, str>),
Identifier(Cow<'a, str>),
Numeric(NumericNode<'a>),
QuotedString(Cow<'a, str>),
TypedString {
data_type: DataType,
value: Cow<'a, str>,
},
Between {
expr: Box<ExprNode<'a>>,
negated: bool,
low: Box<ExprNode<'a>>,
high: Box<ExprNode<'a>>,
},
Like {
expr: Box<ExprNode<'a>>,
negated: bool,
pattern: Box<ExprNode<'a>>,
},
ILike {
expr: Box<ExprNode<'a>>,
negated: bool,
pattern: Box<ExprNode<'a>>,
},
BinaryOp {
left: Box<ExprNode<'a>>,
op: BinaryOperator,
right: Box<ExprNode<'a>>,
},
UnaryOp {
op: UnaryOperator,
expr: Box<ExprNode<'a>>,
},
IsNull(Box<ExprNode<'a>>),
IsNotNull(Box<ExprNode<'a>>),
InList {
expr: Box<ExprNode<'a>>,
list: Box<InListNode<'a>>,
negated: bool,
},
Nested(Box<ExprNode<'a>>),
Function(Box<FunctionNode<'a>>),
Aggregate(Box<AggregateNode<'a>>),
Exists {
subquery: Box<QueryNode<'a>>,
negated: bool,
},
Subquery(Box<QueryNode<'a>>),
Case {
operand: Option<Box<ExprNode<'a>>>,
when_then: Vec<(ExprNode<'a>, ExprNode<'a>)>,
else_result: Option<Box<ExprNode<'a>>>,
},
}
Expand description
Available expression builder functions
Variants§
Expr(Cow<'a, Expr>)
SqlExpr(Cow<'a, str>)
Identifier(Cow<'a, str>)
Numeric(NumericNode<'a>)
QuotedString(Cow<'a, str>)
TypedString
Between
Like
ILike
BinaryOp
UnaryOp
IsNull(Box<ExprNode<'a>>)
IsNotNull(Box<ExprNode<'a>>)
InList
Nested(Box<ExprNode<'a>>)
Function(Box<FunctionNode<'a>>)
Aggregate(Box<AggregateNode<'a>>)
Exists
Subquery(Box<QueryNode<'a>>)
Case
Implementations§
Source§impl<'a> ExprNode<'a>
impl<'a> ExprNode<'a>
pub fn add<T: Into<Self>>(self, other: T) -> Self
pub fn sub<T: Into<Self>>(self, other: T) -> Self
pub fn mul<T: Into<Self>>(self, other: T) -> Self
pub fn div<T: Into<Self>>(self, other: T) -> Self
pub fn modulo<T: Into<Self>>(self, other: T) -> Self
pub fn concat<T: Into<Self>>(self, other: T) -> Self
pub fn gt<T: Into<Self>>(self, other: T) -> Self
pub fn lt<T: Into<Self>>(self, other: T) -> Self
pub fn gte<T: Into<Self>>(self, other: T) -> Self
pub fn lte<T: Into<Self>>(self, other: T) -> Self
pub fn eq<T: Into<Self>>(self, other: T) -> Self
pub fn neq<T: Into<Self>>(self, other: T) -> Self
pub fn and<T: Into<Self>>(self, other: T) -> Self
pub fn or<T: Into<Self>>(self, other: T) -> Self
pub fn bitwise_and<T: Into<Self>>(self, other: T) -> Self
pub fn bitwise_shift_left<T: Into<Self>>(self, other: T) -> Self
pub fn bitwise_shift_right<T: Into<Self>>(self, other: T) -> Self
Source§impl<'a> ExprNode<'a>
impl<'a> ExprNode<'a>
pub fn is_null(self) -> Self
pub fn is_not_null(self) -> Self
Source§impl<'a> ExprNode<'a>
impl<'a> ExprNode<'a>
pub fn count(self) -> ExprNode<'a>
pub fn count_distinct(self) -> ExprNode<'a>
pub fn sum(self) -> ExprNode<'a>
pub fn sum_distinct(self) -> ExprNode<'a>
pub fn min(self) -> ExprNode<'a>
pub fn min_distinct(self) -> ExprNode<'a>
pub fn max(self) -> ExprNode<'a>
pub fn max_distinct(self) -> ExprNode<'a>
pub fn avg(self) -> ExprNode<'a>
pub fn avg_distinct(self) -> ExprNode<'a>
pub fn variance(self) -> ExprNode<'a>
pub fn variance_distinct(self) -> ExprNode<'a>
pub fn stdev(self) -> ExprNode<'a>
pub fn stdev_distinct(self) -> ExprNode<'a>
Source§impl<'a> ExprNode<'a>
impl<'a> ExprNode<'a>
pub fn abs(self) -> ExprNode<'a>
pub fn upper(self) -> ExprNode<'a>
pub fn lower(self) -> ExprNode<'a>
pub fn initcap(self) -> ExprNode<'a>
pub fn ifnull<T: Into<ExprNode<'a>>>(self, another: T) -> ExprNode<'a>
pub fn nullif<T: Into<ExprNode<'a>>>(self, another: T) -> ExprNode<'a>
pub fn ceil(self) -> ExprNode<'a>
pub fn rand(self) -> ExprNode<'a>
pub fn round(self) -> ExprNode<'a>
pub fn trunc(self) -> ExprNode<'a>
pub fn floor(self) -> ExprNode<'a>
pub fn asin(self) -> ExprNode<'a>
pub fn acos(self) -> ExprNode<'a>
pub fn atan(self) -> ExprNode<'a>
pub fn sin(self) -> ExprNode<'a>
pub fn cos(self) -> ExprNode<'a>
pub fn tan(self) -> ExprNode<'a>
pub fn left<T: Into<ExprNode<'a>>>(self, size: T) -> Self
pub fn log<T: Into<ExprNode<'a>>>(self, base: T) -> ExprNode<'a>
pub fn log2(self) -> ExprNode<'a>
pub fn log10(self) -> ExprNode<'a>
pub fn ln(self) -> ExprNode<'a>
pub fn right<T: Into<ExprNode<'a>>>(self, size: T) -> Self
pub fn reverse(self) -> ExprNode<'a>
pub fn sign(self) -> ExprNode<'a>
pub fn skip<T: Into<ExprNode<'a>>>(self, size: T) -> ExprNode<'a>
pub fn power<T: Into<ExprNode<'a>>>(self, pwr: T) -> ExprNode<'a>
pub fn sqrt(self) -> ExprNode<'a>
pub fn gcd<T: Into<ExprNode<'a>>>(self, right: T) -> ExprNode<'a>
pub fn lcm<T: Into<ExprNode<'a>>>(self, right: T) -> ExprNode<'a>
pub fn repeat<T: Into<ExprNode<'a>>>(self, num: T) -> ExprNode<'a>
pub fn replace<T: Into<ExprNode<'a>>, U: Into<ExprNode<'a>>>( self, old: T, new: U, ) -> ExprNode<'a>
pub fn degrees(self) -> ExprNode<'a>
pub fn radians(self) -> ExprNode<'a>
pub fn lpad<T: Into<ExprNode<'a>>>( self, size: T, fill: Option<ExprNode<'a>>, ) -> ExprNode<'a>
pub fn rpad<T: Into<ExprNode<'a>>>( self, size: T, fill: Option<ExprNode<'a>>, ) -> ExprNode<'a>
pub fn take<T: Into<ExprNode<'a>>>(self, size: T) -> ExprNode<'a>
pub fn exp(self) -> ExprNode<'a>
pub fn substr<T: Into<ExprNode<'a>>>( self, start: T, count: Option<ExprNode<'a>>, ) -> ExprNode<'a>
pub fn rtrim(self, chars: Option<ExprNode<'a>>) -> ExprNode<'a>
pub fn ltrim(self, chars: Option<ExprNode<'a>>) -> ExprNode<'a>
pub fn format<T: Into<ExprNode<'a>>>(self, fmt: T) -> ExprNode<'a>
pub fn to_date<T: Into<ExprNode<'a>>>(self, format: T) -> ExprNode<'a>
pub fn to_timestamp<T: Into<ExprNode<'a>>>(self, format: T) -> ExprNode<'a>
pub fn to_time<T: Into<ExprNode<'a>>>(self, format: T) -> ExprNode<'a>
pub fn position<T: Into<ExprNode<'a>>>(self, format: T) -> ExprNode<'a>
pub fn find_idx<T: Into<ExprNode<'a>>>( self, sub: T, start: Option<ExprNode<'a>>, ) -> ExprNode<'a>
pub fn cast<T: Into<DataTypeNode>>(self, data_type: T) -> ExprNode<'a>
pub fn extract(self, field: DateTimeField) -> ExprNode<'a>
pub fn is_empty(self) -> ExprNode<'a>
pub fn last_day(self) -> ExprNode<'a>
pub fn entries(self) -> ExprNode<'a>
pub fn keys(self) -> ExprNode<'a>
pub fn values(self) -> ExprNode<'a>
Trait Implementations§
Source§impl<'a> From<ExprNode<'a>> for OrderByExprList<'a>
impl<'a> From<ExprNode<'a>> for OrderByExprList<'a>
Source§impl<'a> From<ExprNode<'a>> for OrderByExprNode<'a>
impl<'a> From<ExprNode<'a>> for OrderByExprNode<'a>
Source§impl<'a> From<ExprNode<'a>> for SelectItemList<'a>
impl<'a> From<ExprNode<'a>> for SelectItemList<'a>
Source§impl<'a> From<ExprNode<'a>> for SelectItemNode<'a>
impl<'a> From<ExprNode<'a>> for SelectItemNode<'a>
Auto Trait Implementations§
impl<'a> Freeze for ExprNode<'a>
impl<'a> RefUnwindSafe for ExprNode<'a>
impl<'a> Send for ExprNode<'a>
impl<'a> Sync for ExprNode<'a>
impl<'a> Unpin for ExprNode<'a>
impl<'a> UnwindSafe for ExprNode<'a>
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more