upsertRow method
Future<RefreshToken?>
upsertRow(
- DatabaseSession session,
- RefreshToken row, {
- required ColumnSelections<
RefreshTokenTable> conflictColumns, - ColumnSelections<
RefreshTokenTable> ? updateColumns, - WhereExpressionBuilder<
RefreshTokenTable> ? updateWhere, - Transaction? transaction,
Upserts a single RefreshToken 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 RefreshToken will have its id field set.
Implementation
Future<RefreshToken?> upsertRow(
_i1.DatabaseSession session,
RefreshToken row, {
required _i1.ColumnSelections<RefreshTokenTable> conflictColumns,
_i1.ColumnSelections<RefreshTokenTable>? updateColumns,
_i1.WhereExpressionBuilder<RefreshTokenTable>? updateWhere,
_i1.Transaction? transaction,
}) async {
return session.db.upsertRow<RefreshToken>(
row,
conflictColumns: conflictColumns(RefreshToken.t),
updateColumns: updateColumns?.call(RefreshToken.t),
updateWhere: updateWhere?.call(RefreshToken.t),
transaction: transaction,
);
}