diff --git a/drift/lib/src/runtime/manager/manager.dart b/drift/lib/src/runtime/manager/manager.dart index 42ee79ae..22348dfe 100644 --- a/drift/lib/src/runtime/manager/manager.dart +++ b/drift/lib/src/runtime/manager/manager.dart @@ -342,6 +342,12 @@ abstract class BaseTableManager< /// supports setting fields back to null. Future update(Insertable
Function(CU o) f) => $state.buildUpdateStatement().write(f($state._getUpdateCompanionBuilder)); + + /// Return the count of rows matched by the built statement + /// When counting rows, the query will only count distinct rows by default + Future count([bool distinct = true]) { + return $state.copyWith(distinct: true).count(); + } } /// A table manager that can be used to select rows from a table @@ -362,12 +368,6 @@ 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 count([bool distinct = true]) { - return $state.copyWith(distinct: true).count(); - } - /// Checks whether any rows exist Future exists() => $state.exists();