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
46
47
48
49
50
51
use expression::{Expression, AsExpression};
use super::predicates::*;
pub trait PgExpressionMethods: Expression + Sized {
fn is_not_distinct_from<T>(self, other: T)
-> IsNotDistinctFrom<Self, T::Expression> where
T: AsExpression<Self::SqlType>,
{
IsNotDistinctFrom::new(self, other.as_expression())
}
}
impl<T: Expression> PgExpressionMethods for T {}
use super::date_and_time::AtTimeZone;
use types::{VarChar, Timestamp};
#[doc(hidden)]
pub trait PgTimestampExpressionMethods: Expression<SqlType=Timestamp> + Sized {
fn at_time_zone<T>(self, timezone: T) -> AtTimeZone<Self, T::Expression> where
T: AsExpression<VarChar>,
{
AtTimeZone::new(self, timezone.as_expression())
}
}
impl<T: Expression<SqlType=Timestamp>> PgTimestampExpressionMethods for T {}