getAll method

  1. @override
Future<List<Map<String, dynamic>>> getAll(
  1. String table, {
  2. bool includeDeleted = false,
})
override

Returns all rows from table. Default behaviour filters out soft-deleted rows (deleted_at IS NULL). Pass includeDeleted: true for a full listing (e.g. for the sync engine's pull-reconciliation).

Implementation

@override
Future<List<Map<String, dynamic>>> getAll(
  String table, {
  bool includeDeleted = false,
}) async {
  final rows = _tables[table]?.values.toList() ?? <Map<String, dynamic>>[];
  final iter = includeDeleted
      ? rows
      : rows.where((r) => r[SyncColumns.deletedAt] == null);
  return iter.map(Map<String, dynamic>.from).toList();
}