createReturning method
Future<AppConfigData>
createReturning(
- Insertable<
AppConfigData> f(), { - InsertMode? mode,
- UpsertClause<
$AppConfigTable, AppConfigData> ? 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);
}