createReturning method

Future<FaceEmbedding> createReturning(
  1. Insertable<FaceEmbedding> f(
    1. $$FaceEmbeddingsTableCreateCompanionBuilder o
    ), {
  2. InsertMode? mode,
  3. UpsertClause<$FaceEmbeddingsTable, FaceEmbedding>? onConflict,
})
inherited

Inserts a row into the table and returns it.

Depending on the InsertMode or the DoUpdate onConflict clause, the insert statement may not actually insert a row into the database. Since this function was declared to return a non-nullable row, it throws an exception in that case. Use createReturningOrNull when performing an insert with an insert mode like InsertMode.insertOrIgnore or when using a DoUpdate with a where clause clause.

Implementation

Future<$Dataclass> createReturning(
  Insertable<$Dataclass> Function($CreateCompanionCallback o) f, {
  InsertMode? mode,
  UpsertClause<$Table, $Dataclass>? onConflict,
}) {
  return $state.db
      .into($state._tableAsTableInfo)
      .insertReturning(
        f($state._createCompanionCallback),
        mode: mode,
        onConflict: onConflict,
      );
}