query method

Future<List<R>> query(
  1. Session session, {
  2. List<Object>? columns(
    1. C columns
    )?,
  3. Expr<bool>? where(
    1. C columns
    )?,
  4. List<Object>? orderBy(
    1. C columns
    )?,
  5. int? limit,
})

Implementation

Future<List<R>> query(
  Session session, {
  List<Object>? Function(C columns)? columns,
  Expr<bool>? Function(C columns)? where,
  List<Object>? Function(C columns)? orderBy,
  int? limit,
}) async {
  final query = doSelect(
    from: this,
    columns: columns == null ? null : columns(this.columns),
    where: where == null ? null : where(this.columns),
    orderBy: orderBy == null ? null : orderBy(this.columns),
    limit: limit,
  );
  final rs = await session.executeQuery(query);
  return rs.map(rowFn).toList();
}