distict count by defualt

This commit is contained in:
Moshe Dicker 2024-04-06 21:20:11 -04:00
parent c723b4e81e
commit 7a8983dcc4
1 changed files with 6 additions and 3 deletions

View File

@ -301,9 +301,6 @@ abstract class BaseTableManager<
._getChildManagerBuilder($state.copyWith(limit: limit, offset: offset));
}
/// Return the count of rows matched by the built statement
Future<int> count() => $state.count();
/// Writes all non-null fields from the entity into the columns of all rows
/// that match the [filter] clause. Warning: That also means that, when you're
/// not setting a where clause explicitly, this method will update all rows in
@ -338,6 +335,12 @@ abstract class ProcessedTableManager<
/// Create a new [ProcessedTableManager] instance
const ProcessedTableManager(super.$state);
/// Return the count of rows matched by the built statement
/// When counting rows, the query will only count distinct rows by default
Future<int> count([bool distinct = true]) {
return $state.copyWith(distinct: true).count();
}
/// Deletes all rows matched by built statement
///
/// Returns the amount of rows that were deleted by this statement directly