getAll<T extends Serializable> method

Future<List<T>> getAll<T extends Serializable>()

Implementation

Future<List<T>> getAll<T extends Serializable>() async {
  if (!_isOpen) throw const FlutterSqliteException('Database not open');

  final type = T;
  final tableInfo = _tables[type];
  if (tableInfo == null) {
    throw FlutterSqliteException('Table not registered for type $type');
  }

  final sql = 'SELECT * FROM ${tableInfo.tableName}';
  final rows = await _impl!.query(sql);

  return rows.map((row) => _mapRowToObject<T>(row)).toList();
}