hasPending method

  1. @override
Future<bool> hasPending(
  1. String table,
  2. String id
)
override

Check if a specific record has a pending sync entry.

Implementation

@override
Future<bool> hasPending(String table, String id) async {
  final rows = await _db.customSelect(
    'SELECT COUNT(1) AS c FROM dynos_sync_queue '
    'WHERE table_name = ? AND record_id = ? AND synced_at IS NULL',
    variables: [Variable.withString(table), Variable.withString(id)],
  ).get();
  return rows.first.read<int>('c') > 0;
}