pullSince method

  1. @override
Future<List<Map<String, dynamic>>> pullSince(
  1. String table,
  2. DateTime since
)
override

Pull all records from table updated after since.

Return an empty list if nothing changed.

Implementation

@override
Future<List<Map<String, dynamic>>> pullSince(
  String table,
  DateTime since,
) async {
  try {
    final rows = await client
        .from(table)
        .select()
        .gt('updated_at', since.toIso8601String());
    return List<Map<String, dynamic>>.from(rows);
  } on AuthException catch (e) {
    throw AuthExpiredException(e);
  } on FormatException catch (e) {
    throw SyncDeserializationException(e);
  } on TypeError catch (e) {
    throw SyncDeserializationException(e);
  } catch (e) {
    if (_isAuthError(e)) throw AuthExpiredException(e);
    rethrow;
  }
}