Trait diesel::types::HasSqlType [] [src]

pub trait HasSqlType<ST>: TypeMetadata {
    fn metadata(lookup: &Self::MetadataLookup) -> Self::TypeMetadata;

    fn row_metadata(
        out: &mut Vec<Self::TypeMetadata>,
        lookup: &Self::MetadataLookup
    ) { ... } }

Indicates that a SQL type exists for a backend.

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

Provided Methods

Fetch the metadata for a tuple representing an entire row

The default implementation of this method simply calls Self::metadata. You generally should not need to override this method.

However, if you are writing an implementation of HasSqlType that simply delegates to an inner type (for example, Nullable does this), then you should ensure that you delegate this method as well.

Implementors