Crates.io | diesel-enum-sqltype |
lib.rs | diesel-enum-sqltype |
version | 0.1.6 |
source | src |
created_at | 2024-09-05 22:05:58.362459 |
updated_at | 2024-11-28 13:32:56.703423 |
description | Provides derive macro for FromSql and ToSql traits for postgres enums |
homepage | |
repository | https://github.com/korir248/to-from-sql-derive |
max_upload_size | |
id | 1365220 |
size | 8,003 |
A Rust procedural macro library that provides custom derive macros FromSqlDerive
and ToSqlDerive
for seamless PostgreSQL enum serialization and deserialization with Diesel ORM.
FromSql
and ToSql
traits for PostgreSQL enum typesAdd to your Cargo.toml
:
[dependencies]
diesel-enum-sqltype = "0.1.5"
diesel = { version = "x.x.x", features = ["postgres"] }
#[derive(FromSqlDerive, ToSqlDerive)]
#[diesel(sql_type = "YourCustomSqlType")]
enum MyEnum {
Variant1,
Variant2,
Variant3,
}
sql_type
attributeContributions welcome! Please open an issue or submit a pull request.