macro_rules! impl_builder_model {
($struct_name:ident, $table_builder:expr) => { ... };
($struct_name:ident, $table_builder:expr, $pk_field:expr) => { ... };
}Expand description
Macro to automatically implement IgnisModel trait for a struct using builder information
This macro bridges the convenience gap by automatically implementing the IgnisModel trait based on builder configuration, similar to the macro approach.
ยงExample
use ignis_db::builders::*;
struct User {
id: i32,
email: String,
}
// Automatically implement IgnisModel trait
impl_builder_model!(User, table("users").column(column("id", ColumnType::Int4).primary_key()));
// Now User implements IgnisModel automatically
assert_eq!(User::table_name(), "users");
assert_eq!(User::primary_key(), "id");