1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use super::{Expression, AsExpression};
use super::grouped::Grouped;
use types;
pub type SqlTypeOf<Expr> = <Expr as Expression>::SqlType;
pub type AsExpr<Item, TargetExpr> = AsExprOf<Item, SqlTypeOf<TargetExpr>>;
pub type AsExprOf<Item, Type> = <Item as AsExpression<Type>>::Expression;
macro_rules! gen_helper_type {
($name:ident) => {
pub type $name<Lhs, Rhs> = super::operators::$name<Lhs, AsExpr<Rhs, Lhs>>;
};
($name:ident, $tpe:ident) => {
pub type $name<Lhs, Rhs> = super::operators::$name<
Lhs,
<Rhs as AsExpression<types::$tpe>>::Expression,
>;
}
}
gen_helper_type!(Eq);
gen_helper_type!(NotEq);
gen_helper_type!(Gt);
gen_helper_type!(GtEq);
gen_helper_type!(Lt);
gen_helper_type!(LtEq);
gen_helper_type!(And, Bool);
gen_helper_type!(Like, VarChar);
gen_helper_type!(NotLike, VarChar);
pub type Between<Lhs, Rhs> = super::operators::Between<Lhs,
super::operators::And<AsExpr<Rhs, Lhs>, AsExpr<Rhs, Lhs>>>;
pub type NotBetween<Lhs, Rhs> = super::operators::NotBetween<Lhs,
super::operators::And<AsExpr<Rhs, Lhs>, AsExpr<Rhs, Lhs>>>;
pub type Not<Expr> = super::operators::Not<Grouped<AsExprOf<Expr, types::Bool>>>;
#[doc(inline)]
pub use super::operators::{IsNull, IsNotNull, Asc, Desc};
#[doc(inline)]
pub use super::array_comparison::EqAny;