#diesel #enum #derive #postgres #pg #postgresql

macro diesel_enum_derive

Simple Enum derive for [Postgres only] Varchar fields

7 releases (2 stable)

Uses old Rust 2015

1.0.1 Sep 14, 2022
1.0.0 Jun 14, 2022
0.1.4 Feb 4, 2022
0.1.3 Aug 16, 2018
0.1.0 Jul 5, 2018

#475 in Procedural macros

Download history 133/week @ 2023-02-12 117/week @ 2023-02-19 99/week @ 2023-02-26 63/week @ 2023-03-05 81/week @ 2023-03-12 39/week @ 2023-03-19 51/week @ 2023-03-26 33/week @ 2023-04-02 53/week @ 2023-04-09 60/week @ 2023-04-16 56/week @ 2023-04-23 22/week @ 2023-04-30 35/week @ 2023-05-07 16/week @ 2023-05-14 45/week @ 2023-05-21 104/week @ 2023-05-28

200 downloads per month

MIT license

7KB
118 lines

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.

Dependencies

~0.9–1.2MB
~30K SLoC