1 stable release
new 1.1.0 | Feb 15, 2025 |
---|
#1189 in Procedural macros
105 downloads per month
Used in 3 crates
(via episko_lib)
11KB
171 lines
This crate contains the derive Macros for the DatabaseObject
trait
from episko_lib
.
Example
#[derive(DatabaseObject)]
#[db(table = "ExampleProperty")] // Required!
struct ExampleProperty {
#[db(col = "id")] // Column with name "id" is required
id: i32,
#[db(col = "name")] // Any other columns are optional
name: String,
#[db(col = "version")]
version: Option<String>
}
// Implementations for DatabaseObject will now be generated according
// to the specified attributes.
Dependencies
~3.5MB
~72K SLoC