findFirstRow method

Future<MethodInfo?> findFirstRow(
  1. Session session, {
  2. WhereExpressionBuilder<MethodInfoTable>? where,
  3. int? offset,
  4. OrderByBuilder<MethodInfoTable>? orderBy,
  5. bool orderDescending = false,
  6. OrderByListBuilder<MethodInfoTable>? orderByList,
  7. Transaction? transaction,
})

Returns the first matching MethodInfo 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<MethodInfo?> findFirstRow(
  _i1.Session session, {
  _i1.WhereExpressionBuilder<MethodInfoTable>? where,
  int? offset,
  _i1.OrderByBuilder<MethodInfoTable>? orderBy,
  bool orderDescending = false,
  _i1.OrderByListBuilder<MethodInfoTable>? orderByList,
  _i1.Transaction? transaction,
}) async {
  return session.db.findFirstRow<MethodInfo>(
    where: where?.call(MethodInfo.t),
    orderBy: orderBy?.call(MethodInfo.t),
    orderByList: orderByList?.call(MethodInfo.t),
    orderDescending: orderDescending,
    offset: offset,
    transaction: transaction,
  );
}