enqueue method

  1. @override
Future<void> enqueue(
  1. SyncEntry entry
)
override

Add an entry to the sync queue.

Implementation

@override
Future<void> enqueue(SyncEntry entry) async {
  await _db.customStatement(
    'INSERT INTO dynos_sync_queue (id, table_name, record_id, operation, payload, created_at, retry_count, next_retry_at) '
    'VALUES (?, ?, ?, ?, ?, ?, ?, ?)',
    [
      entry.id,
      entry.table,
      entry.recordId,
      entry.operation.name,
      jsonEncode(entry.payload),
      entry.createdAt.millisecondsSinceEpoch,
      entry.retryCount,
      entry.nextRetryAt?.millisecondsSinceEpoch,
    ],
  );
}