pub trait EnumSqlType<const HAS_EXPLICIT_DISCRIMINANT: bool, DB: Backend>: SqlType {
type Strategy: EnumMapping<DB>;
}i-implement-a-third-party-backend-and-opt-into-breaking-changes only.Expand description
A marker trait for SQL types representing database side enums
This trait describes how an enum should be mapped to the underlying database storage type by specifying one of a set of different strategies.
The generic constant HAS_EXPLICIT_DISCRIMINANT can be used to enforce that for a given mapping
the user needs to provide explicit discriminant values. The #[derive(Enum)] macro
will pass the true only if this is the case.
The generic type DB represents the database backend for which this mapping is valid
§Deriving
This trait can be automatically derived by using #[derive(SqlType)]
with the #[diesel(enum_type)] attribute
Required Associated Types§
Sourcetype Strategy: EnumMapping<DB>
type Strategy: EnumMapping<DB>
The mapping strategy used by this type
This mainly exists to share the logic between different SQL types
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl EnumSqlType<true, Mysql> for Unsigned<BigInt>
Available on crate feature mysql_backend only.
impl EnumSqlType<true, Mysql> for Unsigned<BigInt>
mysql_backend only.Source§impl EnumSqlType<true, Mysql> for Unsigned<Integer>
Available on crate feature mysql_backend only.
impl EnumSqlType<true, Mysql> for Unsigned<Integer>
mysql_backend only.Source§impl EnumSqlType<true, Mysql> for Unsigned<SmallInt>
Available on crate feature mysql_backend only.
impl EnumSqlType<true, Mysql> for Unsigned<SmallInt>
mysql_backend only.Source§impl EnumSqlType<true, Mysql> for Unsigned<TinyInt>
Available on crate feature mysql_backend only.
impl EnumSqlType<true, Mysql> for Unsigned<TinyInt>
mysql_backend only.