diesel/sqlite/expression/
helper_types.rs

1use crate::dsl::AsExpr;
2use crate::expression::grouped::Grouped;
3use crate::expression::Expression;
4use crate::expression_methods::JsonIndex;
5
6/// The return type of `lhs.is(rhs)`.
7pub type Is<Lhs, Rhs> = Grouped<super::operators::Is<Lhs, AsExpr<Rhs, Lhs>>>;
8
9/// The return type of `lhs.is_not(rhs)`.
10pub type IsNot<Lhs, Rhs> = Grouped<super::operators::IsNot<Lhs, AsExpr<Rhs, Lhs>>>;
11
12/// The return type of [`lhs.retrieve_as_object(rhs)`](super::expression_methods::SqliteAnyJsonExpressionMethods::retrieve_as_object)
13///
14/// Note: SQLite's `->` operator always returns JSON (TEXT representation), not JSONB
15#[cfg(feature = "sqlite")]
16pub type RetrieveAsObjectSqlite<Lhs, Rhs> = Grouped<
17    crate::sqlite::expression::operators::RetrieveAsObjectSqlite<
18        Lhs,
19        crate::dsl::AsExprOf<
20            <Rhs as JsonIndex>::Expression,
21            <<Rhs as JsonIndex>::Expression as Expression>::SqlType,
22        >,
23    >,
24>;
25
26#[doc(inline)]
27pub use super::return_type_helpers::*;