1mod fold;
17pub mod ops;
18mod ord;
19
20pub use self::fold::Foldable;
21pub use self::ord::SqlOrd;
22
23use crate::backend::Backend;
24use crate::expression::TypedExpressionType;
25use crate::query_builder::QueryId;
26
27#[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
}
}
impl diesel::sql_types::HasSqlType<Bool> for diesel::mariadb::Mariadb
{
fn metadata(_: &mut ()) -> diesel::mariadb::MariadbType {
diesel::mariadb::MariadbType::Tiny
}
}
impl diesel::sql_types::HasSqlType<Bool> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup)
-> diesel::pg::PgTypeMetadata {
diesel::pg::PgTypeMetadata::new(16, 1000)
}
}
};SqlType)]
42#[diesel(postgres_type(oid = 16, array_oid = 1000))]
43#[diesel(sqlite_type(name = "Integer"))]
44#[diesel(mysql_type(name = "Tiny"))]
45#[diesel(mariadb_type(name = "Tiny"))]
46pub struct Bool;
47
48#[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
}
}
impl diesel::sql_types::HasSqlType<TinyInt> for
diesel::mariadb::Mariadb {
fn metadata(_: &mut ()) -> diesel::mariadb::MariadbType {
diesel::mariadb::MariadbType::Tiny
}
}
};SqlType)]
64#[diesel(mysql_type(name = "Tiny"))]
65#[diesel(mariadb_type(name = "Tiny"))]
66pub struct TinyInt;
67#[doc(hidden)]
68pub type Tinyint = TinyInt;
69
70#[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
}
}
impl diesel::sql_types::HasSqlType<SmallInt> for
diesel::mariadb::Mariadb {
fn metadata(_: &mut ()) -> diesel::mariadb::MariadbType {
diesel::mariadb::MariadbType::Short
}
}
impl diesel::sql_types::HasSqlType<SmallInt> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup)
-> diesel::pg::PgTypeMetadata {
diesel::pg::PgTypeMetadata::new(21, 1005)
}
}
};SqlType)]
82#[diesel(postgres_type(oid = 21, array_oid = 1005))]
83#[diesel(sqlite_type(name = "SmallInt"))]
84#[diesel(mysql_type(name = "Short"))]
85#[diesel(mariadb_type(name = "Short"))]
86pub struct SmallInt;
87#[doc(hidden)]
88pub type Int2 = SmallInt;
89#[doc(hidden)]
90pub type Smallint = SmallInt;
91
92#[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
}
}
impl diesel::sql_types::HasSqlType<Integer> for
diesel::mariadb::Mariadb {
fn metadata(_: &mut ()) -> diesel::mariadb::MariadbType {
diesel::mariadb::MariadbType::Long
}
}
impl diesel::sql_types::HasSqlType<Integer> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup)
-> diesel::pg::PgTypeMetadata {
diesel::pg::PgTypeMetadata::new(23, 1007)
}
}
};SqlType)]
104#[diesel(postgres_type(oid = 23, array_oid = 1007))]
105#[diesel(sqlite_type(name = "Integer"))]
106#[diesel(mysql_type(name = "Long"))]
107#[diesel(mariadb_type(name = "Long"))]
108pub struct Integer;
109#[doc(hidden)]
110pub type Int4 = Integer;
111
112#[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
}
}
impl diesel::sql_types::HasSqlType<BigInt> for
diesel::mariadb::Mariadb {
fn metadata(_: &mut ()) -> diesel::mariadb::MariadbType {
diesel::mariadb::MariadbType::LongLong
}
}
impl diesel::sql_types::HasSqlType<BigInt> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup)
-> diesel::pg::PgTypeMetadata {
diesel::pg::PgTypeMetadata::new(20, 1016)
}
}
};SqlType)]
124#[diesel(postgres_type(oid = 20, array_oid = 1016))]
125#[diesel(sqlite_type(name = "Long"))]
126#[diesel(mysql_type(name = "LongLong"))]
127#[diesel(mariadb_type(name = "LongLong"))]
128pub struct BigInt;
129#[doc(hidden)]
130pub type Int8 = BigInt;
131#[doc(hidden)]
132pub type Bigint = BigInt;
133
134#[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
}
}
impl diesel::sql_types::HasSqlType<Float> for diesel::mariadb::Mariadb
{
fn metadata(_: &mut ()) -> diesel::mariadb::MariadbType {
diesel::mariadb::MariadbType::Float
}
}
impl diesel::sql_types::HasSqlType<Float> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup)
-> diesel::pg::PgTypeMetadata {
diesel::pg::PgTypeMetadata::new(700, 1021)
}
}
};SqlType)]
146#[diesel(postgres_type(oid = 700, array_oid = 1021))]
147#[diesel(sqlite_type(name = "Float"))]
148#[diesel(mysql_type(name = "Float"))]
149#[diesel(mariadb_type(name = "Float"))]
150pub struct Float;
151#[doc(hidden)]
152pub type Float4 = Float;
153
154#[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
}
}
impl diesel::sql_types::HasSqlType<Double> for
diesel::mariadb::Mariadb {
fn metadata(_: &mut ()) -> diesel::mariadb::MariadbType {
diesel::mariadb::MariadbType::Double
}
}
impl diesel::sql_types::HasSqlType<Double> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup)
-> diesel::pg::PgTypeMetadata {
diesel::pg::PgTypeMetadata::new(701, 1022)
}
}
};SqlType)]
166#[diesel(postgres_type(oid = 701, array_oid = 1022))]
167#[diesel(sqlite_type(name = "Double"))]
168#[diesel(mysql_type(name = "Double"))]
169#[diesel(mariadb_type(name = "Double"))]
170pub struct Double;
171#[doc(hidden)]
172pub type Float8 = Double;
173
174#[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
}
}
impl diesel::sql_types::HasSqlType<Numeric> for
diesel::mariadb::Mariadb {
fn metadata(_: &mut ()) -> diesel::mariadb::MariadbType {
diesel::mariadb::MariadbType::Numeric
}
}
impl diesel::sql_types::HasSqlType<Numeric> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup)
-> diesel::pg::PgTypeMetadata {
diesel::pg::PgTypeMetadata::new(1700, 1231)
}
}
};SqlType)]
189#[diesel(postgres_type(oid = 1700, array_oid = 1231))]
190#[diesel(mysql_type(name = "Numeric"))]
191#[diesel(mariadb_type(name = "Numeric"))]
192#[diesel(sqlite_type(name = "Double"))]
193pub struct Numeric;
194
195pub type Decimal = Numeric;
197
198#[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
}
}
impl diesel::sql_types::HasSqlType<Text> for diesel::mariadb::Mariadb
{
fn metadata(_: &mut ()) -> diesel::mariadb::MariadbType {
diesel::mariadb::MariadbType::String
}
}
impl diesel::sql_types::HasSqlType<Text> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup)
-> diesel::pg::PgTypeMetadata {
diesel::pg::PgTypeMetadata::new(25, 1009)
}
}
};SqlType)]
217#[diesel(postgres_type(oid = 25, array_oid = 1009))]
218#[diesel(sqlite_type(name = "Text"))]
219#[diesel(mysql_type(name = "String"))]
220#[diesel(mariadb_type(name = "String"))]
221pub struct Text;
222
223pub type VarChar = Text;
233#[doc(hidden)]
234pub type Varchar = VarChar;
235#[doc(hidden)]
236pub type Char = Text;
237#[doc(hidden)]
238pub type Tinytext = Text;
239#[doc(hidden)]
240pub type Mediumtext = Text;
241#[doc(hidden)]
242pub type Longtext = Text;
243
244#[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
}
}
impl diesel::sql_types::HasSqlType<Binary> for
diesel::mariadb::Mariadb {
fn metadata(_: &mut ()) -> diesel::mariadb::MariadbType {
diesel::mariadb::MariadbType::Blob
}
}
impl diesel::sql_types::HasSqlType<Binary> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup)
-> diesel::pg::PgTypeMetadata {
diesel::pg::PgTypeMetadata::new(17, 1001)
}
}
};SqlType)]
261#[diesel(postgres_type(oid = 17, array_oid = 1001))]
262#[diesel(sqlite_type(name = "Binary"))]
263#[diesel(mysql_type(name = "Blob"))]
264#[diesel(mariadb_type(name = "Blob"))]
265pub struct Binary;
266
267#[doc(hidden)]
268pub type Tinyblob = Binary;
269#[doc(hidden)]
270pub type Blob = Binary;
271#[doc(hidden)]
272pub type Mediumblob = Binary;
273#[doc(hidden)]
274pub type Longblob = Binary;
275#[doc(hidden)]
276pub type Varbinary = Binary;
277#[doc(hidden)]
278pub type Bit = Binary;
279
280#[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
}
}
impl diesel::sql_types::HasSqlType<Date> for diesel::mariadb::Mariadb
{
fn metadata(_: &mut ()) -> diesel::mariadb::MariadbType {
diesel::mariadb::MariadbType::Date
}
}
impl diesel::sql_types::HasSqlType<Date> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup)
-> diesel::pg::PgTypeMetadata {
diesel::pg::PgTypeMetadata::new(1082, 1182)
}
}
};SqlType)]
295#[diesel(postgres_type(oid = 1082, array_oid = 1182))]
296#[diesel(sqlite_type(name = "Text"))]
297#[diesel(mysql_type(name = "Date"))]
298#[diesel(mariadb_type(name = "Date"))]
299pub struct Date;
300
301#[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 {}
impl diesel::sql_types::HasSqlType<Interval> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup)
-> diesel::pg::PgTypeMetadata {
diesel::pg::PgTypeMetadata::new(1186, 1187)
}
}
};SqlType)]
322#[diesel(postgres_type(oid = 1186, array_oid = 1187))]
323pub struct Interval;
324
325#[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
}
}
impl diesel::sql_types::HasSqlType<Time> for diesel::mariadb::Mariadb
{
fn metadata(_: &mut ()) -> diesel::mariadb::MariadbType {
diesel::mariadb::MariadbType::Time
}
}
impl diesel::sql_types::HasSqlType<Time> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup)
-> diesel::pg::PgTypeMetadata {
diesel::pg::PgTypeMetadata::new(1083, 1183)
}
}
};SqlType)]
340#[diesel(postgres_type(oid = 1083, array_oid = 1183))]
341#[diesel(sqlite_type(name = "Text"))]
342#[diesel(mysql_type(name = "Time"))]
343#[diesel(mariadb_type(name = "Time"))]
344pub struct Time;
345
346#[allow(rustdoc::redundant_explicit_links)]
347#[cfg_attr(
365 feature = "chrono",
366 doc = " [NaiveDateTime]: chrono::naive::NaiveDateTime"
367)]
368#[cfg_attr(
369 not(feature = "chrono"),
370 doc = " [NaiveDateTime]: https://docs.rs/chrono/*/chrono/naive/struct.NaiveDateTime.html"
371)]
372#[cfg_attr(
373 feature = "time",
374 doc = " [`time::PrimitiveDateTime`]: time::PrimitiveDateTime"
375)]
376#[cfg_attr(
377 not(feature = "time"),
378 doc = " [`time::PrimitiveDateTime`]: https://docs.rs/time/0.3.9/time/struct.PrimitiveDateTime.html"
379)]
380#[cfg_attr(
381 feature = "time",
382 doc = " [`time::OffsetDateTime`]: time::OffsetDateTime"
383)]
384#[cfg_attr(
385 not(feature = "time"),
386 doc = " [`time::OffsetDateTime`]: https://docs.rs/time/0.3.9/time/struct.OffsetDateTime.html"
387)]
388#[derive(#[automatically_derived]
#[allow(rustdoc::redundant_explicit_links)]
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]
#[allow(rustdoc::redundant_explicit_links)]
impl ::core::clone::Clone for Timestamp {
#[inline]
fn clone(&self) -> Timestamp { *self }
}Clone, #[automatically_derived]
#[allow(rustdoc::redundant_explicit_links)]
impl ::core::marker::Copy for Timestamp { }Copy, #[automatically_derived]
#[allow(rustdoc::redundant_explicit_links)]
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
}
}
impl diesel::sql_types::HasSqlType<Timestamp> for
diesel::mariadb::Mariadb {
fn metadata(_: &mut ()) -> diesel::mariadb::MariadbType {
diesel::mariadb::MariadbType::Timestamp
}
}
impl diesel::sql_types::HasSqlType<Timestamp> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup)
-> diesel::pg::PgTypeMetadata {
diesel::pg::PgTypeMetadata::new(1114, 1115)
}
}
};SqlType)]
390#[diesel(postgres_type(oid = 1114, array_oid = 1115))]
391#[diesel(sqlite_type(name = "Text"))]
392#[diesel(mysql_type(name = "Timestamp"))]
393#[diesel(mariadb_type(name = "Timestamp"))]
394pub struct Timestamp;
395
396#[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
}
}
impl diesel::sql_types::HasSqlType<Json> for diesel::mariadb::Mariadb
{
fn metadata(_: &mut ()) -> diesel::mariadb::MariadbType {
diesel::mariadb::MariadbType::String
}
}
impl diesel::sql_types::HasSqlType<Json> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup)
-> diesel::pg::PgTypeMetadata {
diesel::pg::PgTypeMetadata::new(114, 199)
}
}
};SqlType)]
414#[diesel(postgres_type(oid = 114, array_oid = 199))]
415#[diesel(mysql_type(name = "String"))]
416#[diesel(mariadb_type(name = "String"))]
417#[diesel(sqlite_type(name = "Text"))]
418pub struct Json;
419
420#[cfg_attr(
471 feature = "serde_json",
472 doc = "[`serde_json::Value`]: serde_json::value::Value"
473)]
474#[cfg_attr(
475 not(feature = "serde_json"),
476 doc = "[`serde_json::Value`]: https://docs.rs/serde_json/1.0.64/serde_json/value/enum.Value.html"
477)]
478#[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
}
}
impl diesel::sql_types::HasSqlType<Jsonb> for diesel::pg::Pg {
fn metadata(_: &mut Self::MetadataLookup)
-> diesel::pg::PgTypeMetadata {
diesel::pg::PgTypeMetadata::new(3802, 3807)
}
}
};SqlType)]
541#[diesel(postgres_type(oid = 3802, array_oid = 3807))]
542#[diesel(sqlite_type(name = "Binary"))]
543pub struct Jsonb;
544
545#[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)]
559pub struct Nullable<ST>(ST);
560
561impl<ST> SqlType for Nullable<ST>
562where
563 ST: SqlType,
564{
565 type IsNull = is_nullable::IsNullable;
566}
567
568#[doc(inline)]
569#[cfg(feature = "postgres_backend")]
570pub use crate::pg::sql_types::*;
571
572#[doc(inline)]
573#[cfg(any(feature = "mysql_backend", feature = "mariadb_backend"))]
574pub use crate::mysql_like::sql_types::{Datetime, Unsigned};
575
576#[doc(inline)]
577#[cfg(feature = "__sqlite-shared")]
578pub use crate::sqlite::sql_types::Timestamptz as TimestamptzSqlite;
579
580pub trait HasSqlType<ST>: TypeMetadata {
595 fn metadata(lookup: &mut Self::MetadataLookup) -> Self::TypeMetadata;
600}
601
602pub trait TypeMetadata {
604 type TypeMetadata;
610 type MetadataLookup: ?Sized;
615}
616
617pub trait IntoNullable {
620 type Nullable;
624}
625
626impl<T> IntoNullable for T
627where
628 T: SqlType<IsNull = is_nullable::NotNull> + SingleValue,
629{
630 type Nullable = Nullable<T>;
631}
632
633impl<T> IntoNullable for Nullable<T>
634where
635 T: SqlType,
636{
637 type Nullable = Self;
638}
639
640pub trait IntoNotNullable {
643 type NotNullable;
647}
648
649impl<T> IntoNotNullable for T
650where
651 T: SqlType<IsNull = is_nullable::NotNull>,
652{
653 type NotNullable = T;
654}
655
656impl<T> IntoNotNullable for Nullable<T>
657where
658 T: SqlType,
659{
660 type NotNullable = T;
661}
662
663pub trait SingleValue: SqlType {}
674
675impl<T: SqlType + SingleValue> SingleValue for Nullable<T> {}
676
677#[doc(inline)]
678pub use diesel_derives::DieselNumericOps;
679#[doc(inline)]
680pub use diesel_derives::SqlType;
681
682pub trait SqlType: 'static {
689 type IsNull: OneIsNullable<is_nullable::IsNullable> + OneIsNullable<is_nullable::NotNull>;
696
697 #[doc(hidden)]
698 const IS_ARRAY: bool = false;
699}
700
701#[doc = " A marker trait for SQL types representing database side enums"]
#[doc = ""]
#[doc =
" This trait describes how an enum should be mapped to the underlying database storage type"]
#[doc = " by specifying one of a set of different strategies."]
#[doc = ""]
#[doc =
" The generic constant `HAS_EXPLICIT_DISCRIMINANT` can be used to enforce that for a given mapping"]
#[doc =
" the user needs to provide explicit discriminant values. The [`#[derive(Enum)]`](crate::types::Enum) macro"]
#[doc = " will pass the true only if this is the case."]
#[doc = ""]
#[doc =
" The generic type `DB` represents the database backend for which this mapping is valid"]
#[doc = ""]
#[doc = " # Deriving"]
#[doc = ""]
#[doc =
" This trait can be automatically derived by using [`#[derive(SqlType)]`](derive@SqlType)"]
#[doc = " with the `#[diesel(enum_type)]` attribute"]
pub trait EnumSqlType<const HAS_EXPLICIT_DISCRIMINANT : bool,
DB: Backend>: SqlType {
type Strategy: crate::types::enum_::EnumMapping<DB>;
}#[diesel_derives::__diesel_public_if(
717 feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes"
718)]
719pub trait EnumSqlType<const HAS_EXPLICIT_DISCRIMINANT: bool, DB: Backend>: SqlType {
721 type Strategy: crate::types::enum_::EnumMapping<DB>;
725}
726
727pub trait OneIsNullable<Other> {
731 type Out: OneIsNullable<is_nullable::IsNullable> + OneIsNullable<is_nullable::NotNull>;
733}
734
735pub trait AllAreNullable<Other> {
737 type Out: AllAreNullable<is_nullable::NotNull> + AllAreNullable<is_nullable::IsNullable>;
739}
740
741pub trait MaybeNullableType<O> {
746 type Out: SqlType + TypedExpressionType;
748}
749
750pub mod is_nullable {
752 use super::*;
753
754 #[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)]
759 pub struct NotNull;
760
761 #[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)]
767 pub struct IsNullable;
768
769 impl OneIsNullable<NotNull> for NotNull {
770 type Out = NotNull;
771 }
772
773 impl OneIsNullable<IsNullable> for NotNull {
774 type Out = IsNullable;
775 }
776
777 impl OneIsNullable<NotNull> for IsNullable {
778 type Out = IsNullable;
779 }
780
781 impl OneIsNullable<IsNullable> for IsNullable {
782 type Out = IsNullable;
783 }
784
785 impl AllAreNullable<NotNull> for NotNull {
786 type Out = NotNull;
787 }
788
789 impl AllAreNullable<IsNullable> for NotNull {
790 type Out = NotNull;
791 }
792
793 impl AllAreNullable<NotNull> for IsNullable {
794 type Out = NotNull;
795 }
796
797 impl AllAreNullable<IsNullable> for IsNullable {
798 type Out = IsNullable;
799 }
800
801 impl<O> MaybeNullableType<O> for NotNull
802 where
803 O: SqlType + TypedExpressionType,
804 {
805 type Out = O;
806 }
807
808 impl<O> MaybeNullableType<O> for IsNullable
809 where
810 O: SqlType,
811 Nullable<O>: TypedExpressionType,
812 {
813 type Out = Nullable<O>;
814 }
815
816 pub type MaybeNullable<N, T> = <N as MaybeNullableType<T>>::Out;
818
819 pub type OneNullable<T1, T2> = <T1 as OneIsNullable<T2>>::Out;
821
822 pub type IsOneNullable<S1, S2> = OneNullable<IsSqlTypeNullable<S1>, IsSqlTypeNullable<S2>>;
825
826 pub type AreAllNullable<S1, S2> =
829 <IsSqlTypeNullable<S1> as AllAreNullable<IsSqlTypeNullable<S2>>>::Out;
830
831 pub type IsSqlTypeNullable<T> = <T as SqlType>::IsNull;
833}
834
835#[diagnostic::on_unimplemented(
838 message = "`{Self}` is neither `diesel::sql_types::Bool` nor `diesel::sql_types::Nullable<Bool>`",
839 note = "try to provide an expression that produces one of the expected sql types"
840)]
841pub trait BoolOrNullableBool {}
842
843impl BoolOrNullableBool for Bool {}
844impl BoolOrNullableBool for Nullable<Bool> {}
845
846#[doc(inline)]
847pub use crate::expression::expression_types::Untyped;
848
849pub(crate) mod helper {
850 use super::{MaybeNullableType, OneIsNullable, SingleValue};
851
852 pub trait CombinedNullableValue<O, Out>: SingleValue {
853 type Out: SingleValue;
854 }
855
856 impl<T, O, Out> CombinedNullableValue<O, Out> for T
857 where
858 T: SingleValue,
859 O: SingleValue,
860 T::IsNull: OneIsNullable<O::IsNull>,
861 <T::IsNull as OneIsNullable<O::IsNull>>::Out: MaybeNullableType<Out>,
862 <<T::IsNull as OneIsNullable<O::IsNull>>::Out as MaybeNullableType<Out>>::Out: SingleValue,
863 {
864 type Out = <<T::IsNull as OneIsNullable<O::IsNull>>::Out as MaybeNullableType<Out>>::Out;
865 }
866}