sea_query/extension/postgres/
mod.rs

1pub use expr::*;
2pub use extension::*;
3pub use func::*;
4pub use ltree::*;
5pub use select::*;
6pub use types::*;
7
8use crate::types::BinOper;
9
10pub(crate) mod expr;
11pub(crate) mod extension;
12pub(crate) mod func;
13pub(crate) mod interval;
14pub(crate) mod ltree;
15pub(crate) mod select;
16pub(crate) mod types;
17
18/// Postgres-specific binary operators.
19///
20/// For all supported operators (including the standard ones), see [`BinOper`].
21#[derive(Debug, Clone, Copy, PartialEq, Eq)]
22pub enum PgBinOper {
23    ILike,
24    NotILike,
25    Matches,
26    Contains,
27    Contained,
28    Concatenate,
29    Overlap,
30    Similarity,
31    WordSimilarity,
32    StrictWordSimilarity,
33    SimilarityDistance,
34    WordSimilarityDistance,
35    StrictWordSimilarityDistance,
36    /// `->`. Retrieves JSON field as JSON value.
37    GetJsonField,
38    /// `->>`. Retrieves JSON field and casts it to an appropriate SQL type.
39    CastJsonField,
40    /// `~` Regex operator.
41    Regex,
42    /// `~*`. Regex operator with case insensitive matching.
43    RegexCaseInsensitive,
44    #[cfg(feature = "postgres-vector")]
45    EuclideanDistance,
46    #[cfg(feature = "postgres-vector")]
47    NegativeInnerProduct,
48    #[cfg(feature = "postgres-vector")]
49    CosineDistance,
50}
51
52impl From<PgBinOper> for BinOper {
53    fn from(o: PgBinOper) -> Self {
54        Self::PgOperator(o)
55    }
56}