Trait diesel::sql_types::HasSqlType
source · [−]pub trait HasSqlType<ST>: TypeMetadata {
fn metadata(lookup: &mut Self::MetadataLookup) -> Self::TypeMetadata;
}
Expand description
Indicates that a SQL type exists for a backend.
This trait can be derived using the SqlType
derive
Example
#[derive(diesel::sql_types::SqlType)]
#[diesel(postgres_type(oid = 23, array_oid = 1007))]
#[diesel(sqlite_type(name = "Integer"))]
#[diesel(mysql_type(name = "Long"))]
pub struct Integer;
Required Methods
sourcefn metadata(lookup: &mut Self::MetadataLookup) -> Self::TypeMetadata
fn metadata(lookup: &mut Self::MetadataLookup) -> Self::TypeMetadata
Fetch the metadata for the given type
This method may use lookup
to do dynamic runtime lookup. Implementors
of this method should not do dynamic lookup unless absolutely necessary
Implementors
impl HasSqlType<BigInt> for Mysql
impl HasSqlType<BigInt> for Pg
impl HasSqlType<BigInt> for Sqlite
impl HasSqlType<Binary> for Mysql
impl HasSqlType<Binary> for Pg
impl HasSqlType<Binary> for Sqlite
impl HasSqlType<Bool> for Mysql
impl HasSqlType<Bool> for Pg
impl HasSqlType<Bool> for Sqlite
impl HasSqlType<Cidr> for Pg
Available on crate feature
postgres_backend
only.impl HasSqlType<Date> for Mysql
impl HasSqlType<Date> for Pg
impl HasSqlType<Date> for Sqlite
impl HasSqlType<Datetime> for Mysql
Available on crate feature
mysql_backend
only.impl HasSqlType<Double> for Mysql
impl HasSqlType<Double> for Pg
impl HasSqlType<Double> for Sqlite
impl HasSqlType<Float> for Mysql
impl HasSqlType<Float> for Pg
impl HasSqlType<Float> for Sqlite
impl HasSqlType<Inet> for Pg
Available on crate feature
postgres_backend
only.impl HasSqlType<Integer> for Mysql
impl HasSqlType<Integer> for Pg
impl HasSqlType<Integer> for Sqlite
impl HasSqlType<Interval> for Pg
impl HasSqlType<Json> for Mysql
impl HasSqlType<Json> for Pg
impl HasSqlType<Jsonb> for Pg
Available on crate feature
postgres_backend
only.impl HasSqlType<MacAddr> for Pg
Available on crate feature
postgres_backend
only.impl HasSqlType<Money> for Pg
Available on crate feature
postgres_backend
only.impl HasSqlType<Numeric> for Mysql
impl HasSqlType<Numeric> for Pg
impl HasSqlType<Numeric> for Sqlite
impl HasSqlType<Oid> for Pg
Available on crate feature
postgres_backend
only.impl HasSqlType<Range<BigInt>> for Pg
Available on crate feature
postgres_backend
only.impl HasSqlType<Range<Date>> for Pg
Available on crate feature
postgres_backend
only.impl HasSqlType<Range<Integer>> for Pg
Available on crate feature
postgres_backend
only.impl HasSqlType<Range<Numeric>> for Pg
Available on crate feature
postgres_backend
only.impl HasSqlType<Range<Timestamp>> for Pg
Available on crate feature
postgres_backend
only.impl HasSqlType<Range<Timestamptz>> for Pg
Available on crate feature
postgres_backend
only.impl HasSqlType<SmallInt> for Mysql
impl HasSqlType<SmallInt> for Pg
impl HasSqlType<SmallInt> for Sqlite
impl HasSqlType<Text> for Mysql
impl HasSqlType<Text> for Pg
impl HasSqlType<Text> for Sqlite
impl HasSqlType<Time> for Mysql
impl HasSqlType<Time> for Pg
impl HasSqlType<Time> for Sqlite
impl HasSqlType<Timestamp> for Mysql
impl HasSqlType<Timestamp> for Pg
impl HasSqlType<Timestamp> for Sqlite
impl HasSqlType<Timestamptz> for Pg
Available on crate feature
postgres_backend
only.impl HasSqlType<Timestamptz> for Sqlite
Available on crate feature
sqlite
only.impl HasSqlType<TinyInt> for Mysql
impl HasSqlType<Unsigned<BigInt>> for Mysql
Available on crate feature
mysql_backend
only.impl HasSqlType<Unsigned<Integer>> for Mysql
Available on crate feature
mysql_backend
only.impl HasSqlType<Unsigned<SmallInt>> for Mysql
Available on crate feature
mysql_backend
only.impl HasSqlType<Unsigned<TinyInt>> for Mysql
Available on crate feature
mysql_backend
only.impl HasSqlType<Uuid> for Pg
Available on crate feature
postgres_backend
only.impl<ST: 'static> HasSqlType<Record<ST>> for Pg
Available on crate feature
postgres_backend
only.impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, __DB> HasSqlType<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)> for __DBwhere
__DB: HasSqlType<T0>,
__DB: HasSqlType<T1>,
__DB: HasSqlType<T2>,
__DB: HasSqlType<T3>,
__DB: HasSqlType<T4>,
__DB: HasSqlType<T5>,
__DB: HasSqlType<T6>,
__DB: HasSqlType<T7>,
__DB: HasSqlType<T8>,
__DB: HasSqlType<T9>,
__DB: HasSqlType<T10>,
__DB: HasSqlType<T11>,
__DB: HasSqlType<T12>,
__DB: HasSqlType<T13>,
__DB: HasSqlType<T14>,
__DB: HasSqlType<T15>,
__DB: Backend,
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, __DB> HasSqlType<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)> for __DBwhere
__DB: HasSqlType<T0>,
__DB: HasSqlType<T1>,
__DB: HasSqlType<T2>,
__DB: HasSqlType<T3>,
__DB: HasSqlType<T4>,
__DB: HasSqlType<T5>,
__DB: HasSqlType<T6>,
__DB: HasSqlType<T7>,
__DB: HasSqlType<T8>,
__DB: HasSqlType<T9>,
__DB: HasSqlType<T10>,
__DB: HasSqlType<T11>,
__DB: HasSqlType<T12>,
__DB: HasSqlType<T13>,
__DB: HasSqlType<T14>,
__DB: Backend,
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, __DB> HasSqlType<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)> for __DBwhere
__DB: HasSqlType<T0>,
__DB: HasSqlType<T1>,
__DB: HasSqlType<T2>,
__DB: HasSqlType<T3>,
__DB: HasSqlType<T4>,
__DB: HasSqlType<T5>,
__DB: HasSqlType<T6>,
__DB: HasSqlType<T7>,
__DB: HasSqlType<T8>,
__DB: HasSqlType<T9>,
__DB: HasSqlType<T10>,
__DB: HasSqlType<T11>,
__DB: HasSqlType<T12>,
__DB: HasSqlType<T13>,
__DB: Backend,
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, __DB> HasSqlType<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)> for __DBwhere
__DB: HasSqlType<T0>,
__DB: HasSqlType<T1>,
__DB: HasSqlType<T2>,
__DB: HasSqlType<T3>,
__DB: HasSqlType<T4>,
__DB: HasSqlType<T5>,
__DB: HasSqlType<T6>,
__DB: HasSqlType<T7>,
__DB: HasSqlType<T8>,
__DB: HasSqlType<T9>,
__DB: HasSqlType<T10>,
__DB: HasSqlType<T11>,
__DB: HasSqlType<T12>,
__DB: Backend,
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, __DB> HasSqlType<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)> for __DBwhere
__DB: HasSqlType<T0>,
__DB: HasSqlType<T1>,
__DB: HasSqlType<T2>,
__DB: HasSqlType<T3>,
__DB: HasSqlType<T4>,
__DB: HasSqlType<T5>,
__DB: HasSqlType<T6>,
__DB: HasSqlType<T7>,
__DB: HasSqlType<T8>,
__DB: HasSqlType<T9>,
__DB: HasSqlType<T10>,
__DB: HasSqlType<T11>,
__DB: Backend,
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, __DB> HasSqlType<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)> for __DBwhere
__DB: HasSqlType<T0>,
__DB: HasSqlType<T1>,
__DB: HasSqlType<T2>,
__DB: HasSqlType<T3>,
__DB: HasSqlType<T4>,
__DB: HasSqlType<T5>,
__DB: HasSqlType<T6>,
__DB: HasSqlType<T7>,
__DB: HasSqlType<T8>,
__DB: HasSqlType<T9>,
__DB: HasSqlType<T10>,
__DB: Backend,
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, __DB> HasSqlType<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)> for __DBwhere
__DB: HasSqlType<T0>,
__DB: HasSqlType<T1>,
__DB: HasSqlType<T2>,
__DB: HasSqlType<T3>,
__DB: HasSqlType<T4>,
__DB: HasSqlType<T5>,
__DB: HasSqlType<T6>,
__DB: HasSqlType<T7>,
__DB: HasSqlType<T8>,
__DB: HasSqlType<T9>,
__DB: Backend,
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, __DB> HasSqlType<(T0, T1, T2, T3, T4, T5, T6, T7, T8)> for __DBwhere
__DB: HasSqlType<T0>,
__DB: HasSqlType<T1>,
__DB: HasSqlType<T2>,
__DB: HasSqlType<T3>,
__DB: HasSqlType<T4>,
__DB: HasSqlType<T5>,
__DB: HasSqlType<T6>,
__DB: HasSqlType<T7>,
__DB: HasSqlType<T8>,
__DB: Backend,
impl<T0, T1, T2, T3, T4, T5, T6, T7, __DB> HasSqlType<(T0, T1, T2, T3, T4, T5, T6, T7)> for __DBwhere
__DB: HasSqlType<T0>,
__DB: HasSqlType<T1>,
__DB: HasSqlType<T2>,
__DB: HasSqlType<T3>,
__DB: HasSqlType<T4>,
__DB: HasSqlType<T5>,
__DB: HasSqlType<T6>,
__DB: HasSqlType<T7>,
__DB: Backend,
impl<T0, T1, T2, T3, T4, T5, T6, __DB> HasSqlType<(T0, T1, T2, T3, T4, T5, T6)> for __DBwhere
__DB: HasSqlType<T0>,
__DB: HasSqlType<T1>,
__DB: HasSqlType<T2>,
__DB: HasSqlType<T3>,
__DB: HasSqlType<T4>,
__DB: HasSqlType<T5>,
__DB: HasSqlType<T6>,
__DB: Backend,
impl<T0, T1, T2, T3, T4, T5, __DB> HasSqlType<(T0, T1, T2, T3, T4, T5)> for __DBwhere
__DB: HasSqlType<T0>,
__DB: HasSqlType<T1>,
__DB: HasSqlType<T2>,
__DB: HasSqlType<T3>,
__DB: HasSqlType<T4>,
__DB: HasSqlType<T5>,
__DB: Backend,
impl<T0, T1, T2, T3, T4, __DB> HasSqlType<(T0, T1, T2, T3, T4)> for __DBwhere
__DB: HasSqlType<T0>,
__DB: HasSqlType<T1>,
__DB: HasSqlType<T2>,
__DB: HasSqlType<T3>,
__DB: HasSqlType<T4>,
__DB: Backend,
impl<T0, T1, T2, T3, __DB> HasSqlType<(T0, T1, T2, T3)> for __DBwhere
__DB: HasSqlType<T0>,
__DB: HasSqlType<T1>,
__DB: HasSqlType<T2>,
__DB: HasSqlType<T3>,
__DB: Backend,
impl<T0, T1, T2, __DB> HasSqlType<(T0, T1, T2)> for __DBwhere
__DB: HasSqlType<T0>,
__DB: HasSqlType<T1>,
__DB: HasSqlType<T2>,
__DB: Backend,
impl<T0, T1, __DB> HasSqlType<(T0, T1)> for __DBwhere
__DB: HasSqlType<T0>,
__DB: HasSqlType<T1>,
__DB: Backend,
impl<T0, __DB> HasSqlType<(T0,)> for __DBwhere
__DB: HasSqlType<T0>,
__DB: Backend,
impl<T> HasSqlType<Array<T>> for Pgwhere
Pg: HasSqlType<T>,
Available on crate feature
postgres_backend
only.