#[derive(BatchInserter)]
{
// Attributes available to this derive:
#[pgtable]
#[colname]
#[key]
}
Expand description
Generates a {stuct_name}Inserter struct. This struct allows you to easily add many of this struct to a given Postgres table.
Use #[pgtable = “{table_name}”] on the main struct to define the postgres table name.
Use #[colname = “{renamed_elem}”] on a field to specify that this field will be renamed when added to the database.
Use #[key] on a field to specify that you want to upsert when inserting this struct in the database, and that this field is a primary key / unique constraint which is used for checking if the row already exists.