insertReturning method

Future<Row> insertReturning(
  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.

Please note that this function is unsuitable for situations where it is not guaranteed that a row gets inserted (for instance because an upsert clause with a where clause is used). For those instances, use insertReturningOrNull instead.

Implementation

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