From a0b35ec6e0b0ff70d75b3145ba2aeef81d8ab962 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Fri, 12 May 2023 15:15:37 +0200 Subject: [PATCH] Mention where computeWithDatabase is most useful --- drift/lib/isolate.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drift/lib/isolate.dart b/drift/lib/isolate.dart index 9aed6f26..2ce1f95d 100644 --- a/drift/lib/isolate.dart +++ b/drift/lib/isolate.dart @@ -307,6 +307,12 @@ extension ComputeWithDriftIsolate on DB { /// ); /// } /// ``` + /// + /// Note that with the recommended setup of `NativeDatabase.createInBackground`, + /// drift will already use an isolate to run your SQL statements. Using + /// [computeWithDatabase] is beneficial when an an expensive work unit needs + /// to use the database, or when creating the SQL statements itself is + /// expensive. @experimental Future computeWithDatabase({ required FutureOr Function(DB) computation,