| Crates.io | diesel-sqlite-enum-integer |
| lib.rs | diesel-sqlite-enum-integer |
| version | 0.1.0 |
| created_at | 2025-06-07 06:22:48.368525+00 |
| updated_at | 2025-06-07 06:22:48.368525+00 |
| description | This proc macro attribute will allow you to store the enum as integer. |
| homepage | https://github.com/Salman-Sali/diesel-sqlite-enum-integer |
| repository | |
| max_upload_size | |
| id | 1703746 |
| size | 5,723 |
Note: This proc macro derive will only work if your enum does not contain any variant which accepts values.
[dependencies]
num_enum = "*"
diesel = { version = "*", features = ["sqlite"] }
#[diesel_sqlite_enum_integer::enum_to_diesel_integer]
pub enum MyEnum {
One,
Two,
Three
}
#[diesel(table_name = crate::schema::my_entity)]
#[derive(Debug, Queryable, Selectable, Identifiable, Associations, PartialEq, Insertable)]
pub struct MyEntity {
pub id: i32,
pub my_enum: MyEnum
}
diesel::table! {
my_entity (id) {
id -> Integer,
my_enum -> Integer
}
}