1mod fold;
17pub mod ops;
18mod ord;
19
20pub use self::fold::Foldable;
21pub use self::ord::SqlOrd;
22
23use crate::expression::TypedExpressionType;
24use crate::query_builder::QueryId;
25
26#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Bool {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f, "Bool")
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Bool {
#[inline]
fn clone(&self) -> Bool { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Bool { }Copy, #[automatically_derived]
impl ::core::default::Default for Bool {
#[inline]
fn default() -> Bool { Bool {} }
}Default, const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl diesel::query_builder::QueryId for Bool {
type QueryId = Bool<>;
const HAS_STATIC_QUERY_ID: bool = true;
const IS_WINDOW_FUNCTION: bool = false;
}
};QueryId, const _: () =
{
use diesel;
impl diesel::sql_types::SqlType for Bool {
type IsNull = diesel::sql_types::is_nullable::NotNull;
const IS_ARRAY: bool = false;
}
impl diesel::sql_types::SingleValue for Bool {}
impl diesel::sql_types::HasSqlType<Bool> for diesel::sqlite::Sqlite {
fn metadata(_: &mut ()) -> diesel::sqlite::SqliteType {
diesel::sqlite::SqliteType::Integer
}
}
impl diesel::sql_types::HasSqlType<Bool> for diesel::mysql::Mysql {
fn metadata(_: &mut ()) -> diesel::mysql::MysqlType {
diesel::mysql::MysqlType::Tiny
}
}
use diesel::pg::{PgMetadataLookup, PgTypeMetadata};
impl diesel::sql_types::HasSqlType<Bool> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup) -> PgTypeMetadata {
PgTypeMetadata::new(16, 1000)
}
}
};SqlType)]
41#[diesel(postgres_type(oid = 16, array_oid = 1000))]
42#[diesel(sqlite_type(name = "Integer"))]
43#[diesel(mysql_type(name = "Tiny"))]
44pub struct Bool;
45
46#[derive(#[automatically_derived]
impl ::core::fmt::Debug for TinyInt {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f, "TinyInt")
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for TinyInt {
#[inline]
fn clone(&self) -> TinyInt { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for TinyInt { }Copy, #[automatically_derived]
impl ::core::default::Default for TinyInt {
#[inline]
fn default() -> TinyInt { TinyInt {} }
}Default, const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl diesel::query_builder::QueryId for TinyInt {
type QueryId = TinyInt<>;
const HAS_STATIC_QUERY_ID: bool = true;
const IS_WINDOW_FUNCTION: bool = false;
}
};QueryId, const _: () =
{
use diesel;
impl diesel::sql_types::SqlType for TinyInt {
type IsNull = diesel::sql_types::is_nullable::NotNull;
const IS_ARRAY: bool = false;
}
impl diesel::sql_types::SingleValue for TinyInt {}
impl diesel::sql_types::HasSqlType<TinyInt> for diesel::mysql::Mysql {
fn metadata(_: &mut ()) -> diesel::mysql::MysqlType {
diesel::mysql::MysqlType::Tiny
}
}
};SqlType)]
62#[diesel(mysql_type(name = "Tiny"))]
63pub struct TinyInt;
64#[doc(hidden)]
65pub type Tinyint = TinyInt;
66
67#[derive(#[automatically_derived]
impl ::core::fmt::Debug for SmallInt {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f, "SmallInt")
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for SmallInt {
#[inline]
fn clone(&self) -> SmallInt { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for SmallInt { }Copy, #[automatically_derived]
impl ::core::default::Default for SmallInt {
#[inline]
fn default() -> SmallInt { SmallInt {} }
}Default, const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl diesel::query_builder::QueryId for SmallInt {
type QueryId = SmallInt<>;
const HAS_STATIC_QUERY_ID: bool = true;
const IS_WINDOW_FUNCTION: bool = false;
}
};QueryId, const _: () =
{
use diesel;
impl diesel::sql_types::SqlType for SmallInt {
type IsNull = diesel::sql_types::is_nullable::NotNull;
const IS_ARRAY: bool = false;
}
impl diesel::sql_types::SingleValue for SmallInt {}
impl diesel::sql_types::HasSqlType<SmallInt> for
diesel::sqlite::Sqlite {
fn metadata(_: &mut ()) -> diesel::sqlite::SqliteType {
diesel::sqlite::SqliteType::SmallInt
}
}
impl diesel::sql_types::HasSqlType<SmallInt> for diesel::mysql::Mysql
{
fn metadata(_: &mut ()) -> diesel::mysql::MysqlType {
diesel::mysql::MysqlType::Short
}
}
use diesel::pg::{PgMetadataLookup, PgTypeMetadata};
impl diesel::sql_types::HasSqlType<SmallInt> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup) -> PgTypeMetadata {
PgTypeMetadata::new(21, 1005)
}
}
};SqlType)]
79#[diesel(postgres_type(oid = 21, array_oid = 1005))]
80#[diesel(sqlite_type(name = "SmallInt"))]
81#[diesel(mysql_type(name = "Short"))]
82pub struct SmallInt;
83#[doc(hidden)]
84pub type Int2 = SmallInt;
85#[doc(hidden)]
86pub type Smallint = SmallInt;
87
88#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Integer {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f, "Integer")
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Integer {
#[inline]
fn clone(&self) -> Integer { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Integer { }Copy, #[automatically_derived]
impl ::core::default::Default for Integer {
#[inline]
fn default() -> Integer { Integer {} }
}Default, const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl diesel::query_builder::QueryId for Integer {
type QueryId = Integer<>;
const HAS_STATIC_QUERY_ID: bool = true;
const IS_WINDOW_FUNCTION: bool = false;
}
};QueryId, const _: () =
{
use diesel;
impl diesel::sql_types::SqlType for Integer {
type IsNull = diesel::sql_types::is_nullable::NotNull;
const IS_ARRAY: bool = false;
}
impl diesel::sql_types::SingleValue for Integer {}
impl diesel::sql_types::HasSqlType<Integer> for diesel::sqlite::Sqlite
{
fn metadata(_: &mut ()) -> diesel::sqlite::SqliteType {
diesel::sqlite::SqliteType::Integer
}
}
impl diesel::sql_types::HasSqlType<Integer> for diesel::mysql::Mysql {
fn metadata(_: &mut ()) -> diesel::mysql::MysqlType {
diesel::mysql::MysqlType::Long
}
}
use diesel::pg::{PgMetadataLookup, PgTypeMetadata};
impl diesel::sql_types::HasSqlType<Integer> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup) -> PgTypeMetadata {
PgTypeMetadata::new(23, 1007)
}
}
};SqlType)]
100#[diesel(postgres_type(oid = 23, array_oid = 1007))]
101#[diesel(sqlite_type(name = "Integer"))]
102#[diesel(mysql_type(name = "Long"))]
103pub struct Integer;
104#[doc(hidden)]
105pub type Int4 = Integer;
106
107#[derive(#[automatically_derived]
impl ::core::fmt::Debug for BigInt {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f, "BigInt")
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for BigInt {
#[inline]
fn clone(&self) -> BigInt { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for BigInt { }Copy, #[automatically_derived]
impl ::core::default::Default for BigInt {
#[inline]
fn default() -> BigInt { BigInt {} }
}Default, const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl diesel::query_builder::QueryId for BigInt {
type QueryId = BigInt<>;
const HAS_STATIC_QUERY_ID: bool = true;
const IS_WINDOW_FUNCTION: bool = false;
}
};QueryId, const _: () =
{
use diesel;
impl diesel::sql_types::SqlType for BigInt {
type IsNull = diesel::sql_types::is_nullable::NotNull;
const IS_ARRAY: bool = false;
}
impl diesel::sql_types::SingleValue for BigInt {}
impl diesel::sql_types::HasSqlType<BigInt> for diesel::sqlite::Sqlite
{
fn metadata(_: &mut ()) -> diesel::sqlite::SqliteType {
diesel::sqlite::SqliteType::Long
}
}
impl diesel::sql_types::HasSqlType<BigInt> for diesel::mysql::Mysql {
fn metadata(_: &mut ()) -> diesel::mysql::MysqlType {
diesel::mysql::MysqlType::LongLong
}
}
use diesel::pg::{PgMetadataLookup, PgTypeMetadata};
impl diesel::sql_types::HasSqlType<BigInt> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup) -> PgTypeMetadata {
PgTypeMetadata::new(20, 1016)
}
}
};SqlType)]
119#[diesel(postgres_type(oid = 20, array_oid = 1016))]
120#[diesel(sqlite_type(name = "Long"))]
121#[diesel(mysql_type(name = "LongLong"))]
122pub struct BigInt;
123#[doc(hidden)]
124pub type Int8 = BigInt;
125#[doc(hidden)]
126pub type Bigint = BigInt;
127
128#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Float {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f, "Float")
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Float {
#[inline]
fn clone(&self) -> Float { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Float { }Copy, #[automatically_derived]
impl ::core::default::Default for Float {
#[inline]
fn default() -> Float { Float {} }
}Default, const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl diesel::query_builder::QueryId for Float {
type QueryId = Float<>;
const HAS_STATIC_QUERY_ID: bool = true;
const IS_WINDOW_FUNCTION: bool = false;
}
};QueryId, const _: () =
{
use diesel;
impl diesel::sql_types::SqlType for Float {
type IsNull = diesel::sql_types::is_nullable::NotNull;
const IS_ARRAY: bool = false;
}
impl diesel::sql_types::SingleValue for Float {}
impl diesel::sql_types::HasSqlType<Float> for diesel::sqlite::Sqlite {
fn metadata(_: &mut ()) -> diesel::sqlite::SqliteType {
diesel::sqlite::SqliteType::Float
}
}
impl diesel::sql_types::HasSqlType<Float> for diesel::mysql::Mysql {
fn metadata(_: &mut ()) -> diesel::mysql::MysqlType {
diesel::mysql::MysqlType::Float
}
}
use diesel::pg::{PgMetadataLookup, PgTypeMetadata};
impl diesel::sql_types::HasSqlType<Float> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup) -> PgTypeMetadata {
PgTypeMetadata::new(700, 1021)
}
}
};SqlType)]
140#[diesel(postgres_type(oid = 700, array_oid = 1021))]
141#[diesel(sqlite_type(name = "Float"))]
142#[diesel(mysql_type(name = "Float"))]
143pub struct Float;
144#[doc(hidden)]
145pub type Float4 = Float;
146
147#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Double {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f, "Double")
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Double {
#[inline]
fn clone(&self) -> Double { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Double { }Copy, #[automatically_derived]
impl ::core::default::Default for Double {
#[inline]
fn default() -> Double { Double {} }
}Default, const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl diesel::query_builder::QueryId for Double {
type QueryId = Double<>;
const HAS_STATIC_QUERY_ID: bool = true;
const IS_WINDOW_FUNCTION: bool = false;
}
};QueryId, const _: () =
{
use diesel;
impl diesel::sql_types::SqlType for Double {
type IsNull = diesel::sql_types::is_nullable::NotNull;
const IS_ARRAY: bool = false;
}
impl diesel::sql_types::SingleValue for Double {}
impl diesel::sql_types::HasSqlType<Double> for diesel::sqlite::Sqlite
{
fn metadata(_: &mut ()) -> diesel::sqlite::SqliteType {
diesel::sqlite::SqliteType::Double
}
}
impl diesel::sql_types::HasSqlType<Double> for diesel::mysql::Mysql {
fn metadata(_: &mut ()) -> diesel::mysql::MysqlType {
diesel::mysql::MysqlType::Double
}
}
use diesel::pg::{PgMetadataLookup, PgTypeMetadata};
impl diesel::sql_types::HasSqlType<Double> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup) -> PgTypeMetadata {
PgTypeMetadata::new(701, 1022)
}
}
};SqlType)]
159#[diesel(postgres_type(oid = 701, array_oid = 1022))]
160#[diesel(sqlite_type(name = "Double"))]
161#[diesel(mysql_type(name = "Double"))]
162pub struct Double;
163#[doc(hidden)]
164pub type Float8 = Double;
165
166#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Numeric {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f, "Numeric")
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Numeric {
#[inline]
fn clone(&self) -> Numeric { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Numeric { }Copy, #[automatically_derived]
impl ::core::default::Default for Numeric {
#[inline]
fn default() -> Numeric { Numeric {} }
}Default, const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl diesel::query_builder::QueryId for Numeric {
type QueryId = Numeric<>;
const HAS_STATIC_QUERY_ID: bool = true;
const IS_WINDOW_FUNCTION: bool = false;
}
};QueryId, const _: () =
{
use diesel;
impl diesel::sql_types::SqlType for Numeric {
type IsNull = diesel::sql_types::is_nullable::NotNull;
const IS_ARRAY: bool = false;
}
impl diesel::sql_types::SingleValue for Numeric {}
impl diesel::sql_types::HasSqlType<Numeric> for diesel::sqlite::Sqlite
{
fn metadata(_: &mut ()) -> diesel::sqlite::SqliteType {
diesel::sqlite::SqliteType::Double
}
}
impl diesel::sql_types::HasSqlType<Numeric> for diesel::mysql::Mysql {
fn metadata(_: &mut ()) -> diesel::mysql::MysqlType {
diesel::mysql::MysqlType::Numeric
}
}
use diesel::pg::{PgMetadataLookup, PgTypeMetadata};
impl diesel::sql_types::HasSqlType<Numeric> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup) -> PgTypeMetadata {
PgTypeMetadata::new(1700, 1231)
}
}
};SqlType)]
181#[diesel(postgres_type(oid = 1700, array_oid = 1231))]
182#[diesel(mysql_type(name = "Numeric"))]
183#[diesel(sqlite_type(name = "Double"))]
184pub struct Numeric;
185
186pub type Decimal = Numeric;
188
189#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Text {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f, "Text")
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Text {
#[inline]
fn clone(&self) -> Text { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Text { }Copy, #[automatically_derived]
impl ::core::default::Default for Text {
#[inline]
fn default() -> Text { Text {} }
}Default, const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl diesel::query_builder::QueryId for Text {
type QueryId = Text<>;
const HAS_STATIC_QUERY_ID: bool = true;
const IS_WINDOW_FUNCTION: bool = false;
}
};QueryId, const _: () =
{
use diesel;
impl diesel::sql_types::SqlType for Text {
type IsNull = diesel::sql_types::is_nullable::NotNull;
const IS_ARRAY: bool = false;
}
impl diesel::sql_types::SingleValue for Text {}
impl diesel::sql_types::HasSqlType<Text> for diesel::sqlite::Sqlite {
fn metadata(_: &mut ()) -> diesel::sqlite::SqliteType {
diesel::sqlite::SqliteType::Text
}
}
impl diesel::sql_types::HasSqlType<Text> for diesel::mysql::Mysql {
fn metadata(_: &mut ()) -> diesel::mysql::MysqlType {
diesel::mysql::MysqlType::String
}
}
use diesel::pg::{PgMetadataLookup, PgTypeMetadata};
impl diesel::sql_types::HasSqlType<Text> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup) -> PgTypeMetadata {
PgTypeMetadata::new(25, 1009)
}
}
};SqlType)]
208#[diesel(postgres_type(oid = 25, array_oid = 1009))]
209#[diesel(sqlite_type(name = "Text"))]
210#[diesel(mysql_type(name = "String"))]
211pub struct Text;
212
213pub type VarChar = Text;
223#[doc(hidden)]
224pub type Varchar = VarChar;
225#[doc(hidden)]
226pub type Char = Text;
227#[doc(hidden)]
228pub type Tinytext = Text;
229#[doc(hidden)]
230pub type Mediumtext = Text;
231#[doc(hidden)]
232pub type Longtext = Text;
233
234#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Binary {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f, "Binary")
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Binary {
#[inline]
fn clone(&self) -> Binary { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Binary { }Copy, #[automatically_derived]
impl ::core::default::Default for Binary {
#[inline]
fn default() -> Binary { Binary {} }
}Default, const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl diesel::query_builder::QueryId for Binary {
type QueryId = Binary<>;
const HAS_STATIC_QUERY_ID: bool = true;
const IS_WINDOW_FUNCTION: bool = false;
}
};QueryId, const _: () =
{
use diesel;
impl diesel::sql_types::SqlType for Binary {
type IsNull = diesel::sql_types::is_nullable::NotNull;
const IS_ARRAY: bool = false;
}
impl diesel::sql_types::SingleValue for Binary {}
impl diesel::sql_types::HasSqlType<Binary> for diesel::sqlite::Sqlite
{
fn metadata(_: &mut ()) -> diesel::sqlite::SqliteType {
diesel::sqlite::SqliteType::Binary
}
}
impl diesel::sql_types::HasSqlType<Binary> for diesel::mysql::Mysql {
fn metadata(_: &mut ()) -> diesel::mysql::MysqlType {
diesel::mysql::MysqlType::Blob
}
}
use diesel::pg::{PgMetadataLookup, PgTypeMetadata};
impl diesel::sql_types::HasSqlType<Binary> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup) -> PgTypeMetadata {
PgTypeMetadata::new(17, 1001)
}
}
};SqlType)]
251#[diesel(postgres_type(oid = 17, array_oid = 1001))]
252#[diesel(sqlite_type(name = "Binary"))]
253#[diesel(mysql_type(name = "Blob"))]
254pub struct Binary;
255
256#[doc(hidden)]
257pub type Tinyblob = Binary;
258#[doc(hidden)]
259pub type Blob = Binary;
260#[doc(hidden)]
261pub type Mediumblob = Binary;
262#[doc(hidden)]
263pub type Longblob = Binary;
264#[doc(hidden)]
265pub type Varbinary = Binary;
266#[doc(hidden)]
267pub type Bit = Binary;
268
269#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Date {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f, "Date")
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Date {
#[inline]
fn clone(&self) -> Date { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Date { }Copy, #[automatically_derived]
impl ::core::default::Default for Date {
#[inline]
fn default() -> Date { Date {} }
}Default, const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl diesel::query_builder::QueryId for Date {
type QueryId = Date<>;
const HAS_STATIC_QUERY_ID: bool = true;
const IS_WINDOW_FUNCTION: bool = false;
}
};QueryId, const _: () =
{
use diesel;
impl diesel::sql_types::SqlType for Date {
type IsNull = diesel::sql_types::is_nullable::NotNull;
const IS_ARRAY: bool = false;
}
impl diesel::sql_types::SingleValue for Date {}
impl diesel::sql_types::HasSqlType<Date> for diesel::sqlite::Sqlite {
fn metadata(_: &mut ()) -> diesel::sqlite::SqliteType {
diesel::sqlite::SqliteType::Text
}
}
impl diesel::sql_types::HasSqlType<Date> for diesel::mysql::Mysql {
fn metadata(_: &mut ()) -> diesel::mysql::MysqlType {
diesel::mysql::MysqlType::Date
}
}
use diesel::pg::{PgMetadataLookup, PgTypeMetadata};
impl diesel::sql_types::HasSqlType<Date> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup) -> PgTypeMetadata {
PgTypeMetadata::new(1082, 1182)
}
}
};SqlType)]
284#[diesel(postgres_type(oid = 1082, array_oid = 1182))]
285#[diesel(sqlite_type(name = "Text"))]
286#[diesel(mysql_type(name = "Date"))]
287pub struct Date;
288
289#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Interval {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f, "Interval")
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Interval {
#[inline]
fn clone(&self) -> Interval { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Interval { }Copy, #[automatically_derived]
impl ::core::default::Default for Interval {
#[inline]
fn default() -> Interval { Interval {} }
}Default, const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl diesel::query_builder::QueryId for Interval {
type QueryId = Interval<>;
const HAS_STATIC_QUERY_ID: bool = true;
const IS_WINDOW_FUNCTION: bool = false;
}
};QueryId, const _: () =
{
use diesel;
impl diesel::sql_types::SqlType for Interval {
type IsNull = diesel::sql_types::is_nullable::NotNull;
const IS_ARRAY: bool = false;
}
impl diesel::sql_types::SingleValue for Interval {}
use diesel::pg::{PgMetadataLookup, PgTypeMetadata};
impl diesel::sql_types::HasSqlType<Interval> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup) -> PgTypeMetadata {
PgTypeMetadata::new(1186, 1187)
}
}
};SqlType)]
310#[diesel(postgres_type(oid = 1186, array_oid = 1187))]
311pub struct Interval;
312
313#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Time {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f, "Time")
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Time {
#[inline]
fn clone(&self) -> Time { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Time { }Copy, #[automatically_derived]
impl ::core::default::Default for Time {
#[inline]
fn default() -> Time { Time {} }
}Default, const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl diesel::query_builder::QueryId for Time {
type QueryId = Time<>;
const HAS_STATIC_QUERY_ID: bool = true;
const IS_WINDOW_FUNCTION: bool = false;
}
};QueryId, const _: () =
{
use diesel;
impl diesel::sql_types::SqlType for Time {
type IsNull = diesel::sql_types::is_nullable::NotNull;
const IS_ARRAY: bool = false;
}
impl diesel::sql_types::SingleValue for Time {}
impl diesel::sql_types::HasSqlType<Time> for diesel::sqlite::Sqlite {
fn metadata(_: &mut ()) -> diesel::sqlite::SqliteType {
diesel::sqlite::SqliteType::Text
}
}
impl diesel::sql_types::HasSqlType<Time> for diesel::mysql::Mysql {
fn metadata(_: &mut ()) -> diesel::mysql::MysqlType {
diesel::mysql::MysqlType::Time
}
}
use diesel::pg::{PgMetadataLookup, PgTypeMetadata};
impl diesel::sql_types::HasSqlType<Time> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup) -> PgTypeMetadata {
PgTypeMetadata::new(1083, 1183)
}
}
};SqlType)]
328#[diesel(postgres_type(oid = 1083, array_oid = 1183))]
329#[diesel(sqlite_type(name = "Text"))]
330#[diesel(mysql_type(name = "Time"))]
331pub struct Time;
332
333#[cfg_attr(
351 feature = "chrono",
352 doc = " [NaiveDateTime]: chrono::naive::NaiveDateTime"
353)]
354#[cfg_attr(
355 not(feature = "chrono"),
356 doc = " [NaiveDateTime]: https://docs.rs/chrono/*/chrono/naive/struct.NaiveDateTime.html"
357)]
358#[cfg_attr(
359 feature = "time",
360 doc = " [`time::PrimitiveDateTime`]: time::PrimitiveDateTime"
361)]
362#[cfg_attr(
363 not(feature = "time"),
364 doc = " [`time::PrimitiveDateTime`]: https://docs.rs/time/0.3.9/time/struct.PrimitiveDateTime.html"
365)]
366#[cfg_attr(
367 feature = "time",
368 doc = " [`time::OffsetDateTime`]: time::OffsetDateTime"
369)]
370#[cfg_attr(
371 not(feature = "time"),
372 doc = " [`time::OffsetDateTime`]: https://docs.rs/time/0.3.9/time/struct.OffsetDateTime.html"
373)]
374#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Timestamp {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f, "Timestamp")
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Timestamp {
#[inline]
fn clone(&self) -> Timestamp { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Timestamp { }Copy, #[automatically_derived]
impl ::core::default::Default for Timestamp {
#[inline]
fn default() -> Timestamp { Timestamp {} }
}Default, const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl diesel::query_builder::QueryId for Timestamp {
type QueryId = Timestamp<>;
const HAS_STATIC_QUERY_ID: bool = true;
const IS_WINDOW_FUNCTION: bool = false;
}
};QueryId, const _: () =
{
use diesel;
impl diesel::sql_types::SqlType for Timestamp {
type IsNull = diesel::sql_types::is_nullable::NotNull;
const IS_ARRAY: bool = false;
}
impl diesel::sql_types::SingleValue for Timestamp {}
impl diesel::sql_types::HasSqlType<Timestamp> for
diesel::sqlite::Sqlite {
fn metadata(_: &mut ()) -> diesel::sqlite::SqliteType {
diesel::sqlite::SqliteType::Text
}
}
impl diesel::sql_types::HasSqlType<Timestamp> for diesel::mysql::Mysql
{
fn metadata(_: &mut ()) -> diesel::mysql::MysqlType {
diesel::mysql::MysqlType::Timestamp
}
}
use diesel::pg::{PgMetadataLookup, PgTypeMetadata};
impl diesel::sql_types::HasSqlType<Timestamp> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup) -> PgTypeMetadata {
PgTypeMetadata::new(1114, 1115)
}
}
};SqlType)]
376#[diesel(postgres_type(oid = 1114, array_oid = 1115))]
377#[diesel(sqlite_type(name = "Text"))]
378#[diesel(mysql_type(name = "Timestamp"))]
379pub struct Timestamp;
380
381#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Json {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f, "Json")
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Json {
#[inline]
fn clone(&self) -> Json { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Json { }Copy, #[automatically_derived]
impl ::core::default::Default for Json {
#[inline]
fn default() -> Json { Json {} }
}Default, const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl diesel::query_builder::QueryId for Json {
type QueryId = Json<>;
const HAS_STATIC_QUERY_ID: bool = true;
const IS_WINDOW_FUNCTION: bool = false;
}
};QueryId, const _: () =
{
use diesel;
impl diesel::sql_types::SqlType for Json {
type IsNull = diesel::sql_types::is_nullable::NotNull;
const IS_ARRAY: bool = false;
}
impl diesel::sql_types::SingleValue for Json {}
impl diesel::sql_types::HasSqlType<Json> for diesel::sqlite::Sqlite {
fn metadata(_: &mut ()) -> diesel::sqlite::SqliteType {
diesel::sqlite::SqliteType::Text
}
}
impl diesel::sql_types::HasSqlType<Json> for diesel::mysql::Mysql {
fn metadata(_: &mut ()) -> diesel::mysql::MysqlType {
diesel::mysql::MysqlType::String
}
}
use diesel::pg::{PgMetadataLookup, PgTypeMetadata};
impl diesel::sql_types::HasSqlType<Json> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup) -> PgTypeMetadata {
PgTypeMetadata::new(114, 199)
}
}
};SqlType)]
399#[diesel(postgres_type(oid = 114, array_oid = 199))]
400#[diesel(mysql_type(name = "String"))]
401#[diesel(sqlite_type(name = "Text"))]
402pub struct Json;
403
404#[cfg_attr(
455 feature = "serde_json",
456 doc = "[`serde_json::Value`]: serde_json::value::Value"
457)]
458#[cfg_attr(
459 not(feature = "serde_json"),
460 doc = "[`serde_json::Value`]: https://docs.rs/serde_json/1.0.64/serde_json/value/enum.Value.html"
461)]
462#[derive(#[automatically_derived]
impl ::core::fmt::Debug for Jsonb {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f, "Jsonb")
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for Jsonb {
#[inline]
fn clone(&self) -> Jsonb { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Jsonb { }Copy, #[automatically_derived]
impl ::core::default::Default for Jsonb {
#[inline]
fn default() -> Jsonb { Jsonb {} }
}Default, const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl diesel::query_builder::QueryId for Jsonb {
type QueryId = Jsonb<>;
const HAS_STATIC_QUERY_ID: bool = true;
const IS_WINDOW_FUNCTION: bool = false;
}
};QueryId, const _: () =
{
use diesel;
impl diesel::sql_types::SqlType for Jsonb {
type IsNull = diesel::sql_types::is_nullable::NotNull;
const IS_ARRAY: bool = false;
}
impl diesel::sql_types::SingleValue for Jsonb {}
impl diesel::sql_types::HasSqlType<Jsonb> for diesel::sqlite::Sqlite {
fn metadata(_: &mut ()) -> diesel::sqlite::SqliteType {
diesel::sqlite::SqliteType::Binary
}
}
use diesel::pg::{PgMetadataLookup, PgTypeMetadata};
impl diesel::sql_types::HasSqlType<Jsonb> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup) -> PgTypeMetadata {
PgTypeMetadata::new(3802, 3807)
}
}
};SqlType)]
525#[diesel(postgres_type(oid = 3802, array_oid = 3807))]
526#[diesel(sqlite_type(name = "Binary"))]
527pub struct Jsonb;
528
529#[derive(#[automatically_derived]
impl<ST: ::core::fmt::Debug> ::core::fmt::Debug for Nullable<ST> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_tuple_field1_finish(f, "Nullable",
&&self.0)
}
}Debug, #[automatically_derived]
impl<ST: ::core::clone::Clone> ::core::clone::Clone for Nullable<ST> {
#[inline]
fn clone(&self) -> Nullable<ST> {
Nullable(::core::clone::Clone::clone(&self.0))
}
}Clone, #[automatically_derived]
impl<ST: ::core::marker::Copy> ::core::marker::Copy for Nullable<ST> { }Copy, #[automatically_derived]
impl<ST: ::core::default::Default> ::core::default::Default for Nullable<ST> {
#[inline]
fn default() -> Nullable<ST> {
Nullable(::core::default::Default::default())
}
}Default)]
543pub struct Nullable<ST>(ST);
544
545impl<ST> SqlType for Nullable<ST>
546where
547 ST: SqlType,
548{
549 type IsNull = is_nullable::IsNullable;
550}
551
552#[doc(inline)]
553#[cfg(feature = "postgres_backend")]
554pub use crate::pg::sql_types::*;
555
556#[doc(inline)]
557#[cfg(feature = "mysql_backend")]
558pub use crate::mysql::sql_types::{Datetime, Unsigned};
559
560#[doc(inline)]
561#[cfg(feature = "sqlite")]
562pub use crate::sqlite::sql_types::Timestamptz as TimestamptzSqlite;
563
564pub trait HasSqlType<ST>: TypeMetadata {
578 fn metadata(lookup: &mut Self::MetadataLookup) -> Self::TypeMetadata;
583}
584
585pub trait TypeMetadata {
587 type TypeMetadata;
593 type MetadataLookup: ?Sized;
598}
599
600pub trait IntoNullable {
603 type Nullable;
607}
608
609impl<T> IntoNullable for T
610where
611 T: SqlType<IsNull = is_nullable::NotNull> + SingleValue,
612{
613 type Nullable = Nullable<T>;
614}
615
616impl<T> IntoNullable for Nullable<T>
617where
618 T: SqlType,
619{
620 type Nullable = Self;
621}
622
623pub trait IntoNotNullable {
626 type NotNullable;
630}
631
632impl<T> IntoNotNullable for T
633where
634 T: SqlType<IsNull = is_nullable::NotNull>,
635{
636 type NotNullable = T;
637}
638
639impl<T> IntoNotNullable for Nullable<T>
640where
641 T: SqlType,
642{
643 type NotNullable = T;
644}
645
646pub trait SingleValue: SqlType {}
657
658impl<T: SqlType + SingleValue> SingleValue for Nullable<T> {}
659
660#[doc(inline)]
661pub use diesel_derives::DieselNumericOps;
662#[doc(inline)]
663pub use diesel_derives::SqlType;
664
665pub trait SqlType: 'static {
672 type IsNull: OneIsNullable<is_nullable::IsNullable> + OneIsNullable<is_nullable::NotNull>;
679
680 #[doc(hidden)]
681 const IS_ARRAY: bool = false;
682}
683
684pub trait OneIsNullable<Other> {
688 type Out: OneIsNullable<is_nullable::IsNullable> + OneIsNullable<is_nullable::NotNull>;
690}
691
692pub trait AllAreNullable<Other> {
694 type Out: AllAreNullable<is_nullable::NotNull> + AllAreNullable<is_nullable::IsNullable>;
696}
697
698pub trait MaybeNullableType<O> {
703 type Out: SqlType + TypedExpressionType;
705}
706
707pub mod is_nullable {
709 use super::*;
710
711 #[derive(#[automatically_derived]
impl ::core::fmt::Debug for NotNull {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f, "NotNull")
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for NotNull {
#[inline]
fn clone(&self) -> NotNull { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for NotNull { }Copy)]
716 pub struct NotNull;
717
718 #[derive(#[automatically_derived]
impl ::core::fmt::Debug for IsNullable {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f, "IsNullable")
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for IsNullable {
#[inline]
fn clone(&self) -> IsNullable { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for IsNullable { }Copy)]
724 pub struct IsNullable;
725
726 impl OneIsNullable<NotNull> for NotNull {
727 type Out = NotNull;
728 }
729
730 impl OneIsNullable<IsNullable> for NotNull {
731 type Out = IsNullable;
732 }
733
734 impl OneIsNullable<NotNull> for IsNullable {
735 type Out = IsNullable;
736 }
737
738 impl OneIsNullable<IsNullable> for IsNullable {
739 type Out = IsNullable;
740 }
741
742 impl AllAreNullable<NotNull> for NotNull {
743 type Out = NotNull;
744 }
745
746 impl AllAreNullable<IsNullable> for NotNull {
747 type Out = NotNull;
748 }
749
750 impl AllAreNullable<NotNull> for IsNullable {
751 type Out = NotNull;
752 }
753
754 impl AllAreNullable<IsNullable> for IsNullable {
755 type Out = IsNullable;
756 }
757
758 impl<O> MaybeNullableType<O> for NotNull
759 where
760 O: SqlType + TypedExpressionType,
761 {
762 type Out = O;
763 }
764
765 impl<O> MaybeNullableType<O> for IsNullable
766 where
767 O: SqlType,
768 Nullable<O>: TypedExpressionType,
769 {
770 type Out = Nullable<O>;
771 }
772
773 pub type MaybeNullable<N, T> = <N as MaybeNullableType<T>>::Out;
775
776 pub type IsOneNullable<S1, S2> =
779 <IsSqlTypeNullable<S1> as OneIsNullable<IsSqlTypeNullable<S2>>>::Out;
780
781 pub type AreAllNullable<S1, S2> =
784 <IsSqlTypeNullable<S1> as AllAreNullable<IsSqlTypeNullable<S2>>>::Out;
785
786 pub type IsSqlTypeNullable<T> = <T as SqlType>::IsNull;
788}
789
790#[diagnostic::on_unimplemented(
793 message = "`{Self}` is neither `diesel::sql_types::Bool` nor `diesel::sql_types::Nullable<Bool>`",
794 note = "try to provide an expression that produces one of the expected sql types"
795)]
796pub trait BoolOrNullableBool {}
797
798impl BoolOrNullableBool for Bool {}
799impl BoolOrNullableBool for Nullable<Bool> {}
800
801#[doc(inline)]
802pub use crate::expression::expression_types::Untyped;
803
804pub(crate) mod helper {
805 use super::{MaybeNullableType, OneIsNullable, SingleValue};
806
807 pub trait CombinedNullableValue<O, Out>: SingleValue {
808 type Out: SingleValue;
809 }
810
811 impl<T, O, Out> CombinedNullableValue<O, Out> for T
812 where
813 T: SingleValue,
814 O: SingleValue,
815 T::IsNull: OneIsNullable<O::IsNull>,
816 <T::IsNull as OneIsNullable<O::IsNull>>::Out: MaybeNullableType<Out>,
817 <<T::IsNull as OneIsNullable<O::IsNull>>::Out as MaybeNullableType<Out>>::Out: SingleValue,
818 {
819 type Out = <<T::IsNull as OneIsNullable<O::IsNull>>::Out as MaybeNullableType<Out>>::Out;
820 }
821}