#enums #fields #postgresql #derive #diesel #varchar

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

#1720 in Procedural macros

Download history 22/week @ 2024-11-13 26/week @ 2024-11-20 31/week @ 2024-11-27 27/week @ 2024-12-04 20/week @ 2024-12-11 8/week @ 2024-12-18 3/week @ 2024-12-25 8/week @ 2025-01-01 3/week @ 2025-01-08 15/week @ 2025-01-15 5/week @ 2025-01-29 9/week @ 2025-02-05 11/week @ 2025-02-12 19/week @ 2025-02-19 37/week @ 2025-02-26

77 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

~1.5MB
~38K SLoC