| Crates.io | diesel-enum-sqltype |
| lib.rs | diesel-enum-sqltype |
| version | 0.1.7 |
| created_at | 2024-09-05 22:05:58.362459+00 |
| updated_at | 2025-02-18 10:13:34.849766+00 |
| 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,017 |
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.6"
diesel = { version = "x.x.x", features = ["postgres"] }
#[derive(FromSqlDerive, ToSqlDerive)]
#[diesel(sql_type = "PaymentTypeT")] //imported from schema.rs
enum PaymentType {
Card,
Bank,
Wire,
}
sql_type attributeContributions welcome! Please open an issue or submit a pull request.