#[derive(Model)]
{
// Attributes available to this derive:
#[model]
#[field]
}
Expand description
Derive macro for Rango models.
Generates:
impl Model for MyStructwithtable_name()andschema()- Table name defaults to snake_case of the struct name (e.g.
UserProfile→user_profile)
§Example
ⓘ
#[derive(Model)]
struct Article {
id: FieldUuid,
title: FieldVarchar<1, 255>,
body: Option<FieldText>,
#[field(index)]
slug: FieldVarchar<1, 100>,
#[field(auto_now_add)]
created_at: FieldDateTime,
}