//! The types in this module are all shorthand for `PredicateType>`. Since we often need to return concrete types, instead of //! a boxed trait object, these can be useful for writing concise return types. use super::array_comparison::{AsInExpression, In, NotIn}; use super::grouped::Grouped; use super::select_by::SelectBy; use super::{AsExpression, Expression}; use crate::expression; use crate::expression_methods::PreferredBoolSqlType; use crate::sql_types; /// The SQL type of an expression pub type SqlTypeOf = ::SqlType; /// The type of `Item` when converted to an expression with the same type as `TargetExpr` pub type AsExpr = AsExprOf>; /// The type of `Item` when converted to an expression of `Type` pub type AsExprOf = >::Expression; /// The return type of /// [`lhs.eq(rhs)`](crate::expression_methods::ExpressionMethods::eq()) pub type Eq = Grouped>>; /// The return type of /// [`lhs.ne(rhs)`](crate::expression_methods::ExpressionMethods::ne()) pub type NotEq = Grouped>>; #[doc(hidden)] // required for `#[auto_type]` pub type Ne = NotEq; /// The return type of /// [`lhs.eq_any(rhs)`](crate::expression_methods::ExpressionMethods::eq_any()) pub type EqAny = Grouped>>::InExpression>>; /// The return type of /// [`lhs.ne_all(rhs)`](crate::expression_methods::ExpressionMethods::ne_all()) pub type NeAny = Grouped>>::InExpression>>; #[doc(hidden)] // required for `#[auto_type]` pub type NeAll = NeAny; /// The return type of /// [`expr.is_null()`](crate::expression_methods::ExpressionMethods::is_null()) pub type IsNull = Grouped>; /// The return type of /// [`expr.is_not_null()`](crate::expression_methods::ExpressionMethods::is_not_null()) pub type IsNotNull = Grouped>; /// The return type of /// [`lhs.gt(rhs)`](crate::expression_methods::ExpressionMethods::gt()) pub type Gt = Grouped>>; /// The return type of /// [`lhs.ge(rhs)`](crate::expression_methods::ExpressionMethods::ge()) pub type GtEq = Grouped>>; #[doc(hidden)] // required for `#[auto_type]` pub type Ge = GtEq; /// The return type of /// [`lhs.lt(rhs)`](crate::expression_methods::ExpressionMethods::lt()) pub type Lt = Grouped>>; /// The return type of /// [`lhs.le(rhs)`](crate::expression_methods::ExpressionMethods::le()) pub type LtEq = Grouped>>; #[doc(hidden)] // required for `#[auto_type]` pub type Le = LtEq; /// The return type of /// [`lhs.between(lower, upper)`](crate::expression_methods::ExpressionMethods::between()) pub type Between = Grouped< super::operators::Between, AsExpr>>, >; /// The return type of /// [`lhs.not_between(lower, upper)`](crate::expression_methods::ExpressionMethods::not_between()) pub type NotBetween = Grouped< super::operators::NotBetween< Lhs, super::operators::And, AsExpr>, >, >; /// The return type of /// [`lhs.concat(rhs)`](crate::expression_methods::TextExpressionMethods::concat()) pub type Concat = Grouped>>; /// The return type of /// [`expr.cast()`](crate::expression_methods::ExpressionMethods::cast()) pub type Cast = super::cast::Cast; /// The return type of /// [`expr.desc()`](crate::expression_methods::ExpressionMethods::desc()) pub type Desc = super::operators::Desc; /// The return type of /// [`expr.asc()`](crate::expression_methods::ExpressionMethods::asc()) pub type Asc = super::operators::Asc; /// The return type of /// [`expr.nullable()`](crate::expression_methods::NullableExpressionMethods::nullable()) pub type Nullable = super::nullable::Nullable; /// The return type of /// [`expr.assume_not_null()`](crate::expression_methods::NullableExpressionMethods::assume_not_null()) pub type AssumeNotNull = super::assume_not_null::AssumeNotNull; /// The return type of /// [`lhs.and(rhs)`](crate::expression_methods::BoolExpressionMethods::and()) pub type And::PreferredSqlType> = Grouped>>; /// The return type of /// [`lhs.or(rhs)`](crate::expression_methods::BoolExpressionMethods::or()) pub type Or::PreferredSqlType> = Grouped>>; /// The return type of /// [`lhs.escape('x')`](crate::expression_methods::EscapeExpressionMethods::escape()) pub type Escape = Grouped< super::operators::Escape< ::TextExpression, AsExprOf, >, >; /// The return type of /// [`lhs.like(rhs)`](crate::expression_methods::TextExpressionMethods::like()) pub type Like = Grouped>>>; /// The return type of /// [`lhs.not_like(rhs)`](crate::expression_methods::TextExpressionMethods::not_like()) pub type NotLike = Grouped>>>; /// The return type of [`case_when()`](expression::case_when::case_when) #[allow(non_camel_case_types)] // required for `#[auto_type]` pub type case_when::SqlType> = expression::case_when::CaseWhen< expression::case_when::CaseWhenConditionsLeaf, Grouped>>, expression::case_when::NoElseExpression, >; /// The return type of [`case_when(...).when(...)`](expression::CaseWhen::when) pub type When = expression::case_when::CaseWhen< expression::case_when::CaseWhenConditionsIntermediateNode< Grouped, Grouped::OutputExpressionSpecifiedSqlType>>, ::Whens, >, ::Else, >; /// The return type of [`case_when(...).otherwise(...)`](expression::case_when::CaseWhen::otherwise) pub type Otherwise = expression::case_when::CaseWhen< ::Whens, expression::case_when::ElseExpression::OutputExpressionSpecifiedSqlType>>>, >; /// Represents the return type of [`.as_select()`](crate::prelude::SelectableHelper::as_select) pub type AsSelect = SelectBy; /// Represents the return type of [`.into_sql()`](crate::expression::IntoSql::into_sql) pub type IntoSql = AsExprOf; /// The return type of [`alias.field(field)`](crate::query_source::Alias::field) pub type Field = Fields; /// The return type of [`alias.fields(fields)`](crate::query_source::Alias::fields) pub type Fields = ::Source, >>::Out; /// The return type of /// [`l + r`](expression::ops::numeric::Add) pub type Add = >::Output; /// The return type of /// [`l - r`](expression::ops::numeric::Sub) pub type Sub = >::Output; /// The return type of /// [`l * r`](expression::ops::numeric::Mul) pub type Mul = >::Output; /// The return type of /// [`l / r`](expression::ops::numeric::Div) pub type Div = >::Output; // we allow unreachable_pub here // as rustc otherwise shows false positives // for every item in this module. We reexport // everything from `crate::helper_types::` #[doc(inline)] #[allow(unreachable_pub)] pub use super::functions::helper_types::*; #[doc(inline)] #[cfg(feature = "postgres_backend")] #[allow(unreachable_pub)] pub use crate::pg::expression::helper_types::*; #[doc(inline)] #[cfg(feature = "sqlite")] #[allow(unreachable_pub)] pub use crate::sqlite::expression::helper_types::*;