select method

  1. @override
Future<DbResult> select(
  1. String table, {
  2. Map<String, dynamic>? where,
})
override

Retrieves data from the specified table.

  • where: Optional filter conditions (e.g., {'id': 1}).

Implementation

@override
Future<DbResult> select(String table, {Map<String, dynamic>? where}) async {
  if (where == null || where.isEmpty) {
    return _run(_db, 'SELECT * FROM $table;', null);
  }
  final cond = where.keys.map((k) => '$k = ?').join(' AND ');
  return _run(_db, 'SELECT * FROM $table WHERE $cond;', where);
}