createReturningOrNull method

Future<FaceEmbedding?> createReturningOrNull(
  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.

When no row was inserted and no exception was thrown, for instance because InsertMode.insertOrIgnore was used or because the upsert clause had a where clause that didn't match, null is returned instead.

Implementation

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