getOrCreate method
Future<TRow>
getOrCreate({
- required MssqlUniqueMatch key,
- required MssqlWriteAssignments create,
- bool restoreExisting = false,
- bool includeDeleted = false,
Inserts create, or returns the live row that already owns key.
Generated getOrCreateByCode is the usual call. This is the typed
unique-key path; MssqlRepository.firstOrCreate is the predicate
form and is not race-safe on its own.
Implementation
Future<TRow> getOrCreate({
required MssqlUniqueMatch key,
required MssqlWriteAssignments create,
bool restoreExisting = false,
bool includeDeleted = false,
}) => _repository().getOrCreate(
key: key,
create: create,
restoreExisting: restoreExisting,
includeDeleted: includeDeleted,
);