diesel/type_impls/
date_and_time.rs

1#![allow(dead_code)]
2
3use crate::deserialize::FromSqlRow;
4use crate::expression::AsExpression;
5use std::time::SystemTime;
6
7#[derive(const _: () =
    {
        use diesel;
        impl<'__expr>
            diesel::expression::AsExpression<crate::sql_types::Timestamp> for
            &'__expr SystemTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamp,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamp>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamp>>
            for &'__expr SystemTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamp>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamp>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<crate::sql_types::Timestamp> for
            &'__expr2 &'__expr SystemTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamp,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamp>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamp>>
            for &'__expr2 &'__expr SystemTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamp>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamp>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<crate::sql_types::Timestamp>,
            __DB> for SystemTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<crate::sql_types::Timestamp, __DB>
            {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<crate::sql_types::Timestamp,
                        __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<crate::sql_types::Timestamp> for
            SystemTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamp,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamp>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamp>>
            for SystemTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamp>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamp>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
    };AsExpression, const _: () =
    {
        use diesel;
        impl<__DB, __ST> diesel::deserialize::Queryable<__ST, __DB> for
            SystemTime where __DB: diesel::backend::Backend,
            __ST: diesel::sql_types::SingleValue,
            Self: diesel::deserialize::FromSql<__ST, __DB> {
            type Row = Self;
            fn build(row: Self) -> diesel::deserialize::Result<Self> {
                diesel::deserialize::Result::Ok(row)
            }
        }
    };FromSqlRow)]
8#[diesel(foreign_derive)]
9#[diesel(sql_type = crate::sql_types::Timestamp)]
10struct SystemTimeProxy(SystemTime);
11
12#[cfg(feature = "chrono")]
13mod chrono {
14    extern crate chrono;
15    use self::chrono::*;
16    use crate::deserialize::FromSqlRow;
17    use crate::expression::AsExpression;
18    use crate::sql_types::{Date, Interval, Time, Timestamp};
19
20    #[derive(const _: () =
    {
        use diesel;
        impl<'__expr> diesel::expression::AsExpression<Date> for
            &'__expr NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Date, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Date>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>
            for &'__expr NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Date>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2> diesel::expression::AsExpression<Date> for
            &'__expr2 &'__expr NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Date, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Date>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>
            for &'__expr2 &'__expr NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Date>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<Date>, __DB>
            for NaiveDate where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<Date, __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<Date, __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<Date> for NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Date, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Date>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>
            for NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Date>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
    };AsExpression, const _: () =
    {
        use diesel;
        impl<__DB, __ST> diesel::deserialize::Queryable<__ST, __DB> for
            NaiveDate where __DB: diesel::backend::Backend,
            __ST: diesel::sql_types::SingleValue,
            Self: diesel::deserialize::FromSql<__ST, __DB> {
            type Row = Self;
            fn build(row: Self) -> diesel::deserialize::Result<Self> {
                diesel::deserialize::Result::Ok(row)
            }
        }
    };FromSqlRow)]
21    #[diesel(foreign_derive)]
22    #[diesel(sql_type = Date)]
23    struct NaiveDateProxy(NaiveDate);
24
25    #[derive(const _: () =
    {
        use diesel;
        impl<'__expr> diesel::expression::AsExpression<Time> for
            &'__expr NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Time, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Time>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>
            for &'__expr NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Time>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2> diesel::expression::AsExpression<Time> for
            &'__expr2 &'__expr NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Time, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Time>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>
            for &'__expr2 &'__expr NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Time>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<Time>, __DB>
            for NaiveTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<Time, __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<Time, __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<Time> for NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Time, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Time>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>
            for NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Time>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
    };AsExpression, const _: () =
    {
        use diesel;
        impl<__DB, __ST> diesel::deserialize::Queryable<__ST, __DB> for
            NaiveTime where __DB: diesel::backend::Backend,
            __ST: diesel::sql_types::SingleValue,
            Self: diesel::deserialize::FromSql<__ST, __DB> {
            type Row = Self;
            fn build(row: Self) -> diesel::deserialize::Result<Self> {
                diesel::deserialize::Result::Ok(row)
            }
        }
    };FromSqlRow)]
26    #[diesel(foreign_derive)]
27    #[diesel(sql_type = Time)]
28    struct NaiveTimeProxy(NaiveTime);
29
30    #[derive(const _: () =
    {
        use diesel;
        impl<'__expr> diesel::expression::AsExpression<Timestamp> for
            &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Timestamp,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Timestamp>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>
            for &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Timestamp>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2> diesel::expression::AsExpression<Timestamp>
            for &'__expr2 &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Timestamp,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Timestamp>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>
            for &'__expr2 &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Timestamp>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<Timestamp>,
            __DB> for NaiveDateTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<Timestamp, __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<Timestamp, __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<Timestamp> for NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Timestamp,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Timestamp>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>
            for NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Timestamp>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for &'__expr2 &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for &'__expr2 &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
            __DB> for NaiveDateTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<crate::sql_types::Timestamptz,
            __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<crate::sql_types::Timestamptz,
                        __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<crate::sql_types::Datetime> for
            &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Datetime,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Datetime>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>
            for &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<crate::sql_types::Datetime> for
            &'__expr2 &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Datetime,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Datetime>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>
            for &'__expr2 &'__expr NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
            __DB> for NaiveDateTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<crate::sql_types::Datetime, __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<crate::sql_types::Datetime,
                        __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<crate::sql_types::Datetime> for
            NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Datetime,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Datetime>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>
            for NaiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
    };AsExpression, const _: () =
    {
        use diesel;
        impl<__DB, __ST> diesel::deserialize::Queryable<__ST, __DB> for
            NaiveDateTime where __DB: diesel::backend::Backend,
            __ST: diesel::sql_types::SingleValue,
            Self: diesel::deserialize::FromSql<__ST, __DB> {
            type Row = Self;
            fn build(row: Self) -> diesel::deserialize::Result<Self> {
                diesel::deserialize::Result::Ok(row)
            }
        }
    };FromSqlRow)]
31    #[diesel(foreign_derive)]
32    #[diesel(sql_type = Timestamp)]
33    #[cfg_attr(
34        feature = "postgres_backend",
35        diesel(sql_type = crate::sql_types::Timestamptz)
36    )]
37    #[cfg_attr(feature = "mysql_backend", diesel(sql_type = crate::sql_types::Datetime))]
38    struct NaiveDateTimeProxy(NaiveDateTime);
39
40    #[derive(const _: () =
    {
        use diesel;
        impl<Tz: TimeZone, __DB, __ST>
            diesel::deserialize::Queryable<__ST, __DB> for DateTime<Tz> where
            __DB: diesel::backend::Backend,
            __ST: diesel::sql_types::SingleValue,
            Self: diesel::deserialize::FromSql<__ST, __DB> {
            type Row = Self;
            fn build(row: Self) -> diesel::deserialize::Result<Self> {
                diesel::deserialize::Result::Ok(row)
            }
        }
    };FromSqlRow)]
41    #[diesel(foreign_derive)]
42    #[cfg_attr(
43        any(feature = "postgres_backend", feature = "sqlite"),
44        derive(const _: () =
    {
        use diesel;
        impl<'__expr, Tz: TimeZone>
            diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for &'__expr DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, Tz: TimeZone>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for &'__expr DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2, Tz: TimeZone>
            diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for &'__expr2 &'__expr DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2, Tz: TimeZone>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for &'__expr2 &'__expr DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<Tz: TimeZone, __DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
            __DB> for DateTime<Tz> where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<crate::sql_types::Timestamptz,
            __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<crate::sql_types::Timestamptz,
                        __DB>::to_sql(self, out)
            }
        }
        impl<Tz: TimeZone>
            diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<Tz: TimeZone>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, Tz: TimeZone>
            diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>
            for &'__expr DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::TimestamptzSqlite,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, Tz: TimeZone>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>
            for &'__expr DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2, Tz: TimeZone>
            diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>
            for &'__expr2 &'__expr DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::TimestamptzSqlite,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2, Tz: TimeZone>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>
            for &'__expr2 &'__expr DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<Tz: TimeZone, __DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>,
            __DB> for DateTime<Tz> where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<crate::sql_types::TimestamptzSqlite,
            __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<crate::sql_types::TimestamptzSqlite,
                        __DB>::to_sql(self, out)
            }
        }
        impl<Tz: TimeZone>
            diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>
            for DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::TimestamptzSqlite,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<Tz: TimeZone>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>
            for DateTime<Tz> {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
    };AsExpression)
45    )]
46    #[cfg_attr(
47        feature = "postgres_backend",
48        diesel(sql_type = crate::sql_types::Timestamptz)
49    )]
50    #[cfg_attr(feature = "sqlite", diesel(sql_type = crate::sql_types::TimestamptzSqlite))]
51    struct DateTimeProxy<Tz: TimeZone>(DateTime<Tz>);
52
53    #[derive(const _: () =
    {
        use diesel;
        impl<'__expr> diesel::expression::AsExpression<Interval> for
            &'__expr Duration {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Interval,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Interval>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Interval>>
            for &'__expr Duration {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Interval>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Interval>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2> diesel::expression::AsExpression<Interval> for
            &'__expr2 &'__expr Duration {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Interval,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Interval>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Interval>>
            for &'__expr2 &'__expr Duration {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Interval>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Interval>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<Interval>,
            __DB> for Duration where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<Interval, __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<Interval, __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<Interval> for Duration {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Interval,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Interval>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<Interval>>
            for Duration {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Interval>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Interval>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
    };AsExpression, const _: () =
    {
        use diesel;
        impl<__DB, __ST> diesel::deserialize::Queryable<__ST, __DB> for
            Duration where __DB: diesel::backend::Backend,
            __ST: diesel::sql_types::SingleValue,
            Self: diesel::deserialize::FromSql<__ST, __DB> {
            type Row = Self;
            fn build(row: Self) -> diesel::deserialize::Result<Self> {
                diesel::deserialize::Result::Ok(row)
            }
        }
    };FromSqlRow)]
54    #[diesel(foreign_derive)]
55    #[diesel(sql_type = Interval)]
56    struct DurationProxy(Duration);
57}
58
59#[cfg(feature = "time")]
60mod time {
61    use time::{Date as NaiveDate, OffsetDateTime, PrimitiveDateTime, Time as NaiveTime};
62
63    use crate::deserialize::FromSqlRow;
64    use crate::expression::AsExpression;
65    use crate::sql_types::{Date, Time, Timestamp};
66
67    #[derive(const _: () =
    {
        use diesel;
        impl<'__expr> diesel::expression::AsExpression<Date> for
            &'__expr NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Date, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Date>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>
            for &'__expr NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Date>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2> diesel::expression::AsExpression<Date> for
            &'__expr2 &'__expr NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Date, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Date>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>
            for &'__expr2 &'__expr NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Date>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<Date>, __DB>
            for NaiveDate where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<Date, __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<Date, __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<Date> for NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Date, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Date>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>
            for NaiveDate {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Date>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Date>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
    };AsExpression, const _: () =
    {
        use diesel;
        impl<__DB, __ST> diesel::deserialize::Queryable<__ST, __DB> for
            NaiveDate where __DB: diesel::backend::Backend,
            __ST: diesel::sql_types::SingleValue,
            Self: diesel::deserialize::FromSql<__ST, __DB> {
            type Row = Self;
            fn build(row: Self) -> diesel::deserialize::Result<Self> {
                diesel::deserialize::Result::Ok(row)
            }
        }
    };FromSqlRow)]
68    #[diesel(foreign_derive)]
69    #[diesel(sql_type = Date)]
70    struct NaiveDateProxy(NaiveDate);
71
72    #[derive(const _: () =
    {
        use diesel;
        impl<'__expr> diesel::expression::AsExpression<Time> for
            &'__expr NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Time, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Time>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>
            for &'__expr NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Time>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2> diesel::expression::AsExpression<Time> for
            &'__expr2 &'__expr NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Time, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Time>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>
            for &'__expr2 &'__expr NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Time>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<Time>, __DB>
            for NaiveTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<Time, __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<Time, __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<Time> for NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Time, Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Time>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>
            for NaiveTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Time>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Time>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
    };AsExpression, const _: () =
    {
        use diesel;
        impl<__DB, __ST> diesel::deserialize::Queryable<__ST, __DB> for
            NaiveTime where __DB: diesel::backend::Backend,
            __ST: diesel::sql_types::SingleValue,
            Self: diesel::deserialize::FromSql<__ST, __DB> {
            type Row = Self;
            fn build(row: Self) -> diesel::deserialize::Result<Self> {
                diesel::deserialize::Result::Ok(row)
            }
        }
    };FromSqlRow)]
73    #[diesel(foreign_derive)]
74    #[diesel(sql_type = Time)]
75    struct NaiveTimeProxy(NaiveTime);
76
77    #[derive(const _: () =
    {
        use diesel;
        impl<'__expr> diesel::expression::AsExpression<Timestamp> for
            &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Timestamp,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Timestamp>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>
            for &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Timestamp>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2> diesel::expression::AsExpression<Timestamp>
            for &'__expr2 &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Timestamp,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Timestamp>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>
            for &'__expr2 &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Timestamp>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<Timestamp>,
            __DB> for PrimitiveDateTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<Timestamp, __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<Timestamp, __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<Timestamp> for PrimitiveDateTime
            {
            type Expression =
                diesel::internal::derives::as_expression::Bound<Timestamp,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<Timestamp>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>
            for PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<Timestamp>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<Timestamp>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for &'__expr2 &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for &'__expr2 &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
            __DB> for PrimitiveDateTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<crate::sql_types::Timestamptz,
            __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<crate::sql_types::Timestamptz,
                        __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<crate::sql_types::Datetime> for
            &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Datetime,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Datetime>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>
            for &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<crate::sql_types::Datetime> for
            &'__expr2 &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Datetime,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Datetime>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>
            for &'__expr2 &'__expr PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
            __DB> for PrimitiveDateTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<crate::sql_types::Datetime, __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<crate::sql_types::Datetime,
                        __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<crate::sql_types::Datetime> for
            PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Datetime,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Datetime>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>
            for PrimitiveDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
    };AsExpression, const _: () =
    {
        use diesel;
        impl<__DB, __ST> diesel::deserialize::Queryable<__ST, __DB> for
            PrimitiveDateTime where __DB: diesel::backend::Backend,
            __ST: diesel::sql_types::SingleValue,
            Self: diesel::deserialize::FromSql<__ST, __DB> {
            type Row = Self;
            fn build(row: Self) -> diesel::deserialize::Result<Self> {
                diesel::deserialize::Result::Ok(row)
            }
        }
    };FromSqlRow)]
78    #[diesel(foreign_derive)]
79    #[diesel(sql_type = Timestamp)]
80    #[cfg_attr(
81        feature = "postgres_backend",
82        diesel(sql_type = crate::sql_types::Timestamptz)
83    )]
84    #[cfg_attr(feature = "mysql_backend", diesel(sql_type = crate::sql_types::Datetime))]
85    struct NaiveDateTimeProxy(PrimitiveDateTime);
86
87    #[derive(const _: () =
    {
        use diesel;
        impl<__DB, __ST> diesel::deserialize::Queryable<__ST, __DB> for
            OffsetDateTime where __DB: diesel::backend::Backend,
            __ST: diesel::sql_types::SingleValue,
            Self: diesel::deserialize::FromSql<__ST, __DB> {
            type Row = Self;
            fn build(row: Self) -> diesel::deserialize::Result<Self> {
                diesel::deserialize::Result::Ok(row)
            }
        }
    };FromSqlRow)]
88    #[diesel(foreign_derive)]
89    #[cfg_attr(
90        any(
91            feature = "postgres_backend",
92            feature = "sqlite",
93            feature = "mysql_backend"
94        ),
95        derive(const _: () =
    {
        use diesel;
        impl<'__expr>
            diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for &'__expr2 &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for &'__expr2 &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
            __DB> for OffsetDateTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<crate::sql_types::Timestamptz,
            __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<crate::sql_types::Timestamptz,
                        __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<crate::sql_types::Timestamptz>
            for OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Timestamptz,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Timestamptz>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>
            for OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Timestamptz>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>
            for &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::TimestamptzSqlite,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>
            for &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>
            for &'__expr2 &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::TimestamptzSqlite,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>
            for &'__expr2 &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>,
            __DB> for OffsetDateTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<crate::sql_types::TimestamptzSqlite,
            __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<crate::sql_types::TimestamptzSqlite,
                        __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>
            for OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::TimestamptzSqlite,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::TimestamptzSqlite>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>
            for OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::TimestamptzSqlite>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<crate::sql_types::Datetime> for
            &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Datetime,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Datetime>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>
            for &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<crate::sql_types::Datetime> for
            &'__expr2 &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Datetime,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Datetime>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<'__expr, '__expr2>
            diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>
            for &'__expr2 &'__expr OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl<__DB>
            diesel::serialize::ToSql<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
            __DB> for OffsetDateTime where __DB: diesel::backend::Backend,
            Self: diesel::serialize::ToSql<crate::sql_types::Datetime, __DB> {
            fn to_sql<'__b>(&'__b self,
                out: &mut diesel::serialize::Output<'__b, '_, __DB>)
                -> diesel::serialize::Result {
                diesel::serialize::ToSql::<crate::sql_types::Datetime,
                        __DB>::to_sql(self, out)
            }
        }
        impl diesel::expression::AsExpression<crate::sql_types::Datetime> for
            OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<crate::sql_types::Datetime,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<crate::sql_types::Datetime>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
        impl diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>
            for OffsetDateTime {
            type Expression =
                diesel::internal::derives::as_expression::Bound<diesel::sql_types::Nullable<crate::sql_types::Datetime>,
                Self>;
            fn as_expression(self)
                ->
                    <Self as
                    diesel::expression::AsExpression<diesel::sql_types::Nullable<crate::sql_types::Datetime>>>::Expression {
                diesel::internal::derives::as_expression::Bound::new(self)
            }
        }
    };AsExpression)
96    )]
97    #[cfg_attr(
98        feature = "postgres_backend",
99        diesel(sql_type = crate::sql_types::Timestamptz)
100    )]
101    #[cfg_attr(feature = "sqlite", diesel(sql_type = crate::sql_types::TimestamptzSqlite))]
102    #[cfg_attr(feature = "mysql_backend", diesel(sql_type = crate::sql_types::Datetime))]
103    struct DateTimeProxy(OffsetDateTime);
104}