File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
packages/sqlite_async/lib/src Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,9 @@ class SqliteOptions {
32
32
33
33
/// Whether queries should be added to the `dart:developer` timeline.
34
34
///
35
- /// This is disabled by default, but can be enabled to identify long-running
36
- /// queries.
35
+ /// By default, this is enabled if the `dart.vm.product` compile-time variable
36
+ /// is not set to `true` . For Flutter apps, this means that [profileQueries]
37
+ /// is enabled by default in debug and profile mode.
37
38
final bool profileQueries;
38
39
39
40
const factory SqliteOptions .defaults () = SqliteOptions ;
@@ -44,8 +45,12 @@ class SqliteOptions {
44
45
this .synchronous = SqliteSynchronous .normal,
45
46
this .webSqliteOptions = const WebSqliteOptions .defaults (),
46
47
this .lockTimeout = const Duration (seconds: 30 ),
47
- this .profileQueries = false ,
48
+ this .profileQueries = _profileQueriesByDefault ,
48
49
});
50
+
51
+ // https://api.flutter.dev/flutter/foundation/kReleaseMode-constant.html
52
+ static const _profileQueriesByDefault =
53
+ ! bool .fromEnvironment ('dart.vm.product' );
49
54
}
50
55
51
56
/// SQLite journal mode. Set on the primary connection.
You can’t perform that action at this time.
0 commit comments