Skip to main content

insert_many

Macro insert_many 

Source
macro_rules! insert_many {
    ($models:expr) => { ... };
}
Expand description

Create a bulk INSERT query for multiple models.

§Example

let heroes = vec![hero1, hero2, hero3];
let count = insert_many!(heroes)
    .execute(cx, &conn)
    .await?;

// With UPSERT
insert_many!(heroes)
    .on_conflict_do_update(&["name", "age"])
    .execute(cx, &conn)
    .await?;