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§

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§