Enum sqlparser::ast::BinaryOperator
source · pub enum BinaryOperator {
Show 49 variants
Plus,
Minus,
Multiply,
Divide,
Modulo,
StringConcat,
Gt,
Lt,
GtEq,
LtEq,
Spaceship,
Eq,
NotEq,
And,
Or,
Xor,
BitwiseOr,
BitwiseAnd,
BitwiseXor,
DuckIntegerDivide,
MyIntegerDivide,
Custom(String),
PGBitwiseXor,
PGBitwiseShiftLeft,
PGBitwiseShiftRight,
PGExp,
PGOverlap,
PGRegexMatch,
PGRegexIMatch,
PGRegexNotMatch,
PGRegexNotIMatch,
PGLikeMatch,
PGILikeMatch,
PGNotLikeMatch,
PGNotILikeMatch,
PGStartsWith,
Arrow,
LongArrow,
HashArrow,
HashLongArrow,
AtAt,
AtArrow,
ArrowAt,
HashMinus,
AtQuestion,
Question,
QuestionAnd,
QuestionPipe,
PGCustomBinaryOperator(Vec<String>),
}
Expand description
Binary operators
Variants§
Plus
Plus, e.g. a + b
Minus
Minus, e.g. a - b
Multiply
Multiply, e.g. a * b
Divide
Divide, e.g. a / b
Modulo
Modulo, e.g. a % b
StringConcat
String/Array Concat operator, e.g. a || b
Gt
Greater than, e.g. a > b
Lt
Less than, e.g. a < b
GtEq
Greater equal, e.g. a >= b
LtEq
Less equal, e.g. a <= b
Spaceship
Spaceship, e.g. a <=> b
Eq
Equal, e.g. a = b
NotEq
Not equal, e.g. a <> b
And
And, e.g. a AND b
Or
Or, e.g. a OR b
Xor
XOR, e.g. a XOR b
BitwiseOr
Bitwise or, e.g. a | b
BitwiseAnd
Bitwise and, e.g. a & b
BitwiseXor
Bitwise XOR, e.g. a ^ b
DuckIntegerDivide
Integer division operator //
in DuckDB
MyIntegerDivide
MySQL DIV
integer division
Custom(String)
Support for custom operators (built by parsers outside this crate)
PGBitwiseXor
Bitwise XOR, e.g. a # b
(PostgreSQL-specific)
PGBitwiseShiftLeft
Bitwise shift left, e.g. a << b
(PostgreSQL-specific)
PGBitwiseShiftRight
Bitwise shift right, e.g. a >> b
(PostgreSQL-specific)
PGExp
Exponent, e.g. a ^ b
(PostgreSQL-specific)
PGOverlap
Overlap operator, e.g. a && b
(PostgreSQL-specific)
PGRegexMatch
String matches regular expression (case sensitively), e.g. a ~ b
(PostgreSQL-specific)
PGRegexIMatch
String matches regular expression (case insensitively), e.g. a ~* b
(PostgreSQL-specific)
PGRegexNotMatch
String does not match regular expression (case sensitively), e.g. a !~ b
(PostgreSQL-specific)
PGRegexNotIMatch
String does not match regular expression (case insensitively), e.g. a !~* b
(PostgreSQL-specific)
PGLikeMatch
String matches pattern (case sensitively), e.g. a ~~ b
(PostgreSQL-specific)
PGILikeMatch
String matches pattern (case insensitively), e.g. a ~~* b
(PostgreSQL-specific)
PGNotLikeMatch
String does not match pattern (case sensitively), e.g. a !~~ b
(PostgreSQL-specific)
PGNotILikeMatch
String does not match pattern (case insensitively), e.g. a !~~* b
(PostgreSQL-specific)
PGStartsWith
String “starts with”, eg: a ^@ b
(PostgreSQL-specific)
Arrow
The ->
operator.
On PostgreSQL, this operator extracts a JSON object field or array
element, for example '{"a":"b"}'::json -> 'a'
or [1, 2, 3]'::json -> 2
.
See https://www.postgresql.org/docs/current/functions-json.html.
LongArrow
The ->>
operator.
On PostgreSQL, this operator that extracts a JSON object field or JSON
array element and converts it to text, for example '{"a":"b"}'::json ->> 'a'
or [1, 2, 3]'::json ->> 2
.
See https://www.postgresql.org/docs/current/functions-json.html.
HashArrow
The #>
operator.
On PostgreSQL, this operator extracts a JSON sub-object at the specified path, for example:
'{"a": {"b": ["foo","bar"]}}'::json #> '{a,b,1}'
See https://www.postgresql.org/docs/current/functions-json.html.
HashLongArrow
The #>>
operator.
A PostgreSQL-specific operator that extracts JSON sub-object at the specified path, for example
'{"a": {"b": ["foo","bar"]}}'::json #>> '{a,b,1}'
See https://www.postgresql.org/docs/current/functions-json.html.
AtAt
The @@
operator.
On PostgreSQL, this is used for JSON and text searches.
See https://www.postgresql.org/docs/current/functions-json.html. See https://www.postgresql.org/docs/current/functions-textsearch.html.
AtArrow
The @>
operator.
On PostgreSQL, this is used for JSON and text searches.
See https://www.postgresql.org/docs/current/functions-json.html. See https://www.postgresql.org/docs/current/functions-textsearch.html.
ArrowAt
The <@
operator.
On PostgreSQL, this is used for JSON and text searches.
See https://www.postgresql.org/docs/current/functions-json.html. See https://www.postgresql.org/docs/current/functions-textsearch.html.
HashMinus
The #-
operator.
On PostgreSQL, this operator is used to delete a field or array element at a specified path.
See https://www.postgresql.org/docs/current/functions-json.html.
AtQuestion
The @?
operator.
On PostgreSQL, this operator is used to check the given JSON path returns an item for the JSON value.
See https://www.postgresql.org/docs/current/functions-json.html.
Question
The ?
operator.
On PostgreSQL, this operator is used to check whether a string exists as a top-level key within the JSON value
See https://www.postgresql.org/docs/current/functions-json.html.
QuestionAnd
The ?&
operator.
On PostgreSQL, this operator is used to check whether all of the the indicated array members exist as top-level keys.
See https://www.postgresql.org/docs/current/functions-json.html.
QuestionPipe
The ?|
operator.
On PostgreSQL, this operator is used to check whether any of the the indicated array members exist as top-level keys.
See https://www.postgresql.org/docs/current/functions-json.html.
PGCustomBinaryOperator(Vec<String>)
PostgreSQL-specific custom operator.
See CREATE OPERATOR for more information.
Trait Implementations§
source§impl Clone for BinaryOperator
impl Clone for BinaryOperator
source§fn clone(&self) -> BinaryOperator
fn clone(&self) -> BinaryOperator
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for BinaryOperator
impl Debug for BinaryOperator
source§impl<'de> Deserialize<'de> for BinaryOperator
impl<'de> Deserialize<'de> for BinaryOperator
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Display for BinaryOperator
impl Display for BinaryOperator
source§impl Hash for BinaryOperator
impl Hash for BinaryOperator
source§impl Ord for BinaryOperator
impl Ord for BinaryOperator
source§fn cmp(&self, other: &BinaryOperator) -> Ordering
fn cmp(&self, other: &BinaryOperator) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for BinaryOperator
impl PartialEq for BinaryOperator
source§fn eq(&self, other: &BinaryOperator) -> bool
fn eq(&self, other: &BinaryOperator) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for BinaryOperator
impl PartialOrd for BinaryOperator
source§fn partial_cmp(&self, other: &BinaryOperator) -> Option<Ordering>
fn partial_cmp(&self, other: &BinaryOperator) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more