insertReturning method

Future<Row> insertReturning(
  1. Insertable<Row> row, {
  2. UpsertClause<Row, RS>? 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, {
  UpsertClause<Row, RS>? onConflict,
}) {
  return insert().insertReturning(row, onConflict: onConflict);
}