selectFirst method
Future<T?>
selectFirst({
- ConditionQuery where(
- T model
- List<
FieldOrder> orderBy(- T model
- int? offset,
- List<
FieldWithValue> desiredFields(- T model
Get first entry matching the query.
Implementation
Future<T?> selectFirst(
{ConditionQuery Function(T model)? where,
List<FieldOrder> Function(T model)? orderBy,
int? offset,
List<FieldWithValue> Function(T model)? desiredFields}) async {
var result = (await select(
where: where, orderBy: orderBy, limit: 1, offset: offset));
return result.isNotEmpty ? result.first : null;
}