From f17c251126d0e2b02f0ad2d2c9b53ec5f1b8d97d Mon Sep 17 00:00:00 2001 From: Moshe Dicker Date: Wed, 17 Apr 2024 12:23:42 -0400 Subject: [PATCH] move count to base manager --- drift/lib/src/runtime/manager/manager.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drift/lib/src/runtime/manager/manager.dart b/drift/lib/src/runtime/manager/manager.dart index 22348dfe..0485f0f8 100644 --- a/drift/lib/src/runtime/manager/manager.dart +++ b/drift/lib/src/runtime/manager/manager.dart @@ -348,6 +348,9 @@ abstract class BaseTableManager< Future count([bool distinct = true]) { return $state.copyWith(distinct: true).count(); } + + /// Checks whether any rows exist + Future exists() => $state.exists(); } /// A table manager that can be used to select rows from a table @@ -368,9 +371,6 @@ abstract class ProcessedTableManager< /// Create a new [ProcessedTableManager] instance const ProcessedTableManager(super.$state); - /// Checks whether any rows exist - Future exists() => $state.exists(); - /// Deletes all rows matched by built statement /// /// Returns the amount of rows that were deleted by this statement directly