getUploadQueueStats method

Future<UploadQueueStats> getUploadQueueStats({
  1. bool includeSize = false,
})
inherited

Get upload queue size estimate and count.

Implementation

Future<UploadQueueStats> getUploadQueueStats(
    {bool includeSize = false}) async {
  if (includeSize) {
    final row = await getOptional(
        'SELECT SUM(cast(data as blob) + 20) as size, count(*) as count FROM ps_crud');
    return UploadQueueStats(
        count: row?['count'] ?? 0, size: row?['size'] ?? 0);
  } else {
    final row = await getOptional('SELECT count(*) as count FROM ps_crud');
    return UploadQueueStats(count: row?['count'] ?? 0);
  }
}