mirror of
https://github.com/Phundrak/georm.git
synced 2025-06-25 17:34:57 +00:00
Introduces support for `#[georm(defaultable)]` attribute on entity fields. When fields are marked as defaultable, generates companion `<Entity>Default` structs where defaultable fields become `Option<T>`, enabling easier entity creation when some fields have database defaults or are auto-generated. Key features: - Generates `<Entity>Default` structs with optional defaultable fields - Implements `Defaultable<Id, Entity>` trait with async `create` method - Validates that `Option<T>` fields cannot be marked as defaultable - Preserves field visibility in generated companion structs - Only generates companion struct when defaultable fields are present