insertReturningOrNull method

Future<Row?> insertReturningOrNull(
  1. Insertable<Row> row, {
  2. InsertMode? mode,
  3. UpsertClause<Tbl, Row>? onConflict,
})

Inserts one row into this table and returns it, along with auto-generated fields.

When neither an insert nor an error happened (for instance because an onConflict clause with a where clause was used), returns null.

Implementation

Future<Row?> insertReturningOrNull(
  Insertable<Row> row, {
  InsertMode? mode,
  UpsertClause<Tbl, Row>? onConflict,
}) {
  return insert().insertReturningOrNull(
    row,
    mode: mode,
    onConflict: onConflict,
  );
}