Skip to main content

sql_builder/extension/sqlite/
mod.rs

1//! SQLite's own operators and expressions.
2
3pub use expr::SqliteExpr;
4
5use crate::types::BinOper;
6
7mod expr;
8
9binary_operators! {
10    /// The binary operators only SQLite has; [`BinOper`] holds them alongside the standard
11    /// ones.
12    pub enum SqliteBinOper {
13        /// matches a Unix file-name pattern, case-sensitively.
14        Glob = "GLOB",
15        /// full-text search, answered by the table or function that defines it.
16        Match = "MATCH",
17        /// a JSON object member or array element, as JSON text.
18        GetJsonField = "->",
19        /// a JSON object member or array element, as an SQL value.
20        CastJsonField = "->>",
21    }
22}
23
24impl From<SqliteBinOper> for BinOper {
25    fn from(o: SqliteBinOper) -> Self {
26        Self::SqliteOperator(o)
27    }
28}