Drift
sqflite
is introduced in the official cookbook to persist data. But Drift (a.k.a moor) is another strong option to use SQLite in Flutter app.
Sentry
Sentry is well known as error tracking tool, but also you can use to monitor performance. Competitors are Datadog/New Relic/Firebase Crashlytics.
Drift & Sentry
Unfortunately, however, there is no library available for linking Sentry with Drift. I made it with reference to sentry_sqflite.
Usage
LazyDatabase _openConnection() {
return LazyDatabase(() async {
final dbFolder = await getApplicationDocumentsDirectory();
final file = File(p.join(dbFolder.path, 'db.sqlite'));
// Use .addSentry() to wrap QueryExecutor
return NativeDatabase.createInBackground(file).addSentry();
});
}
Finally, it is the measurement result:
Top comments (0)