mapFromRowOrNull method
Like mapFromRow, but returns null if a non-nullable column of this table
is null in row
.
Implementation
Future<D?> mapFromRowOrNull(QueryRow row, {String? tablePrefix}) {
final resolvedPrefix = tablePrefix == null ? '' : '$tablePrefix.';
final notInRow = $columns
.where((c) => !c.$nullable)
.any((e) => row.data['$resolvedPrefix${e.$name}'] == null);
if (notInRow) return Future.value(null);
return mapFromRow(row, tablePrefix: tablePrefix);
}