diesel_enum_derive

Crates.iodiesel_enum_derive
lib.rsdiesel_enum_derive
version1.0.1
sourcesrc
created_at2018-07-05 09:23:50.625196
updated_at2022-09-14 15:48:29.3646
descriptionSimple Enum derive for [Postgres only] Varchar fields
homepagehttps://github.com/terry90/diesel-enum-derive
repositoryhttps://github.com/terry90/diesel-enum-derive
max_upload_size
id72956
size7,963
Terry Raimondo (terry90)

documentation

README

Diesel enum derive

Please note that this crate is aimed to be simple and stick to a simple usage, no fancy configuration, only Pg with Text fields.

For a more advanced usage, see this crate: adwhit/diesel-derive-enum

Usage

#[derive(DieselEnum)]
pub enum Role {
    Admin,
    User,
}

The method Role::Admin.db_value() returns the database representation of this variant.

Commit count: 17

cargo fmt