upsertRow method
Future<DatabaseMigrationVersion?>
upsertRow(
- DatabaseSession session,
- DatabaseMigrationVersion row, {
- required ColumnSelections<
DatabaseMigrationVersionTable> conflictColumns, - ColumnSelections<
DatabaseMigrationVersionTable> ? updateColumns, - WhereExpressionBuilder<
DatabaseMigrationVersionTable> ? updateWhere, - Transaction? transaction,
Upserts a single DatabaseMigrationVersion and returns the resulting row.
If the row conflicts on the given conflictColumns, the existing row is
updated. Otherwise, a new row is inserted.
If updateColumns is provided, only those columns will be updated on
conflict. If null, all non-conflict, non-id columns are updated.
If updateWhere is provided, the update only applies when the existing
row matches the expression. Returns null if no row was affected — for
example when updateWhere does not match the conflicting row.
The returned DatabaseMigrationVersion will have its id field set.
Implementation
Future<DatabaseMigrationVersion?> upsertRow(
_i2.DatabaseSession session,
DatabaseMigrationVersion row, {
required _i2.ColumnSelections<DatabaseMigrationVersionTable>
conflictColumns,
_i2.ColumnSelections<DatabaseMigrationVersionTable>? updateColumns,
_i2.WhereExpressionBuilder<DatabaseMigrationVersionTable>? updateWhere,
_i2.Transaction? transaction,
}) async {
return session.db.upsertRow<DatabaseMigrationVersion>(
row,
conflictColumns: conflictColumns(DatabaseMigrationVersion.t),
updateColumns: updateColumns?.call(DatabaseMigrationVersion.t),
updateWhere: updateWhere?.call(DatabaseMigrationVersion.t),
transaction: transaction,
);
}