findFirstRow method
Future<LogEntry?>
findFirstRow(
- Session session, {
- WhereExpressionBuilder<
LogEntryTable> ? where, - int? offset,
- OrderByBuilder<
LogEntryTable> ? orderBy, - bool orderDescending = false,
- OrderByListBuilder<
LogEntryTable> ? orderByList, - Transaction? transaction,
Returns the first matching LogEntry matching the given query parameters.
Use where
to specify which items to include in the return value.
If none is specified, all items will be returned.
To specify the order use orderBy
or orderByList
when sorting by multiple columns.
offset
defines how many items to skip, after which the next one will be picked.
var youngestPerson = await Persons.db.findFirstRow(
session,
where: (t) => t.lastName.equals('Jones'),
orderBy: (t) => t.age,
);
Implementation
Future<LogEntry?> findFirstRow(
_i1.Session session, {
_i1.WhereExpressionBuilder<LogEntryTable>? where,
int? offset,
_i1.OrderByBuilder<LogEntryTable>? orderBy,
bool orderDescending = false,
_i1.OrderByListBuilder<LogEntryTable>? orderByList,
_i1.Transaction? transaction,
}) async {
return session.db.findFirstRow<LogEntry>(
where: where?.call(LogEntry.t),
orderBy: orderBy?.call(LogEntry.t),
orderByList: orderByList?.call(LogEntry.t),
orderDescending: orderDescending,
offset: offset,
transaction: transaction,
);
}