pub enum Operator {
Show 35 variants
Eq,
Ne,
Gt,
Gte,
Lt,
Lte,
Fuzzy,
In,
NotIn,
IsNull,
IsNotNull,
Contains,
KeyExists,
JsonExists,
JsonQuery,
JsonValue,
Like,
NotLike,
ILike,
NotILike,
Between,
NotBetween,
Exists,
NotExists,
Regex,
RegexI,
SimilarTo,
ContainedBy,
Overlaps,
TextSearch,
KeyExistsAny,
KeyExistsAll,
JsonPath,
JsonPathText,
ArrayElemContainedInText,
}Expand description
Comparison / filtering operator.
Variants§
Eq
=
Ne
!=
Gt
>
Gte
>=
Lt
<
Lte
<=
Fuzzy
Case-insensitive LIKE (legacy alias for ILike).
In
IN (list).
NotIn
NOT IN (list).
IsNull
IS NULL.
IsNotNull
IS NOT NULL.
Contains
JSONB @> containment.
KeyExists
JSONB ? key existence.
JsonExists
JSON_EXISTS path check.
JsonQuery
JSON_QUERY path extraction.
JsonValue
JSON_VALUE scalar extraction.
Like
LIKE pattern match.
NotLike
NOT LIKE.
ILike
ILIKE (case-insensitive).
NotILike
NOT ILIKE.
Between
BETWEEN low AND high.
NotBetween
NOT BETWEEN.
Exists
EXISTS (subquery).
NotExists
NOT EXISTS (subquery).
Regex
POSIX regex ~.
RegexI
Case-insensitive regex ~*.
SimilarTo
SIMILAR TO.
ContainedBy
JSONB <@ contained-by.
Overlaps
Array && overlap.
TextSearch
Full-text search @@.
KeyExistsAny
?| — does JSONB contain ANY of the given keys?
KeyExistsAll
?& — does JSONB contain ALL of the given keys?
JsonPath
#> — JSONB path extraction → jsonb
JsonPathText
#>> — JSONB path extraction → text
ArrayElemContainedInText
LOWER(text) LIKE '%' || LOWER(array_element) || '%' over unnest(array_column).
Used for “does input text contain any keyword token?” matching.
Implementations§
Source§impl Operator
impl Operator
Sourcepub fn sql_symbol(&self) -> &'static str
pub fn sql_symbol(&self) -> &'static str
For simple operators, returns the symbol directly. For complex operators (BETWEEN, EXISTS), returns the keyword.
Sourcepub fn needs_value(&self) -> bool
pub fn needs_value(&self) -> bool
IS NULL, IS NOT NULL, EXISTS, NOT EXISTS don’t need values.
Sourcepub fn is_simple_binary(&self) -> bool
pub fn is_simple_binary(&self) -> bool
Returns true for simple binary operators (=, !=, >, <, LIKE, ILIKE, etc.).