Derive Macro pg_worm::Model

source ·
#[derive(Model)]
{
    // Attributes available to this derive:
    #[table]
    #[column]
}
Expand description

Automatically implement Model for your struct.

Attributes

  • table - for structs:
    • table_name: String: optional. Overwrites the table name
  • column - for struct fields:
    • dtype: String: optional. Overwrites the postgres datatype
    • unique: bool: optional, default: false. Enables the unqiue constraint.
    • auto: bool: optional, default: false. This autogenerated the values.
    • column_name: String: optional. Overwrites the column name.