insert method

Future<List<UserProfile>> insert(
  1. DatabaseSession session,
  2. List<UserProfile> rows, {
  3. Transaction? transaction,
  4. bool ignoreConflicts = false,
  5. bool noReturn = false,
})

Inserts all UserProfiles in the list and returns the inserted rows.

The returned UserProfiles will have their id fields set.

This is an atomic operation, meaning that if one of the rows fails to insert, none of the rows will be inserted.

If ignoreConflicts is set to true, rows that conflict with existing rows are silently skipped, and only the successfully inserted rows are returned.

If noReturn is set to true, the inserted rows are not read back from the database and an empty list is returned. This avoids the overhead of transferring and deserializing the rows when the result is not needed.

Implementation

Future<List<UserProfile>> insert(
  _i1.DatabaseSession session,
  List<UserProfile> rows, {
  _i1.Transaction? transaction,
  bool ignoreConflicts = false,
  bool noReturn = false,
}) async {
  return session.db.insert<UserProfile>(
    rows,
    transaction: transaction,
    ignoreConflicts: ignoreConflicts,
    noReturn: noReturn,
  );
}