insertAll<Row extends Object, RS extends GeneratedTable<Row, RS>> method

void insertAll<Row extends Object, RS extends GeneratedTable<Row, RS>>(
  1. GeneratedTable<Row, RS> table,
  2. Iterable<Insertable<Row>> rows, {
  3. UpsertClause<Row, RS>? onConflict,
})

Inserts all rows into the table.

Using insertAll will not disable primary keys or any column constraint checks.

onConflict can be used to create an upsert clause for engines that support it. For details and examples, see InsertStatement.insert.

Implementation

void insertAll<Row extends Object, RS extends GeneratedTable<Row, RS>>(
  GeneratedTable<Row, RS> table,
  Iterable<Insertable<Row>> rows, {
  UpsertClause<Row, RS>? onConflict,
}) {
  for (final row in rows) {
    insert<Row, RS>(table, row, onConflict: onConflict);
  }
}