Count matching records
Future<int> countSql() async { final sql = _buildCountSql(); return repository.executeCount(sql, _params); }