pub enum BinOp {
Show 23 variants
Or,
And,
Eq,
NotEq,
IsDistinctFrom,
IsNotDistinctFrom,
Lt,
LtEq,
Gt,
GtEq,
Add,
Sub,
Mul,
Div,
L2Distance,
InnerProduct,
CosineDistance,
Concat,
JsonGet,
JsonGetText,
JsonGetPath,
JsonGetPathText,
JsonContains,
}Variants§
Or
And
Eq
NotEq
IsDistinctFrom
v7.9.27b — PG a IS DISTINCT FROM b / a IS NOT DISTINCT FROM b. NULL-safe equality: NULL IS NOT DISTINCT FROM
NULL → true, NULL IS DISTINCT FROM NULL → false. The
non-NULL behaviour matches <> / = exactly. Common in
PG-style JOIN ON predicates and pg_dump output.
IsNotDistinctFrom
Lt
LtEq
Gt
GtEq
Add
Sub
Mul
Div
L2Distance
pgvector L2 (Euclidean) distance <->. Defined for two vector
operands of equal dimension; engine returns Value::Float(d).
InnerProduct
pgvector inner-product <#> — returns -Σ aᵢ bᵢ so “smaller =
more similar” remains true (matches pgvector’s published convention).
CosineDistance
pgvector cosine distance <=> — 1 - (a·b)/(|a| |b|).
Concat
SQL string concatenation ||. NULL propagates.
JsonGet
v4.14 json -> key — element access by string key (object)
or integer index (array). Returns a JSON value.
JsonGetText
v4.14 json ->> key — same access, returns the result as
TEXT (unwraps a top-level JSON string; renders other scalars
as their canonical text).
JsonGetPath
v6.4.5 json #> path_text — walk the path encoded as a PG
text array literal like '{a,0,b}'. Returns JSON.
JsonGetPathText
v6.4.5 json #>> path_text — same walk, returns TEXT.
JsonContains
v6.4.5 json @> sub_json — containment. Returns BOOL; true
when every key/value in sub_json is structurally present in
the left side. Matches PG semantics (top-level + recursive).