mirror of https://github.com/AMT-Cheif/drift.git
Mention where computeWithDatabase is most useful
This commit is contained in:
parent
20b75bd7e3
commit
a0b35ec6e0
|
@ -307,6 +307,12 @@ extension ComputeWithDriftIsolate<DB extends DatabaseConnectionUser> 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
|
@experimental
|
||||||
Future<Ret> computeWithDatabase<Ret>({
|
Future<Ret> computeWithDatabase<Ret>({
|
||||||
required FutureOr<Ret> Function(DB) computation,
|
required FutureOr<Ret> Function(DB) computation,
|
||||||
|
|
Loading…
Reference in New Issue