From a00e6d498e3c139a69b5868c13c70b780c2a5cf9 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Sat, 1 Feb 2020 16:08:14 +0100 Subject: [PATCH] Expand docs, add changelog entry --- moor_flutter/CHANGELOG.md | 5 +++++ moor_flutter/lib/moor_flutter.dart | 12 +++++++++++- moor_flutter/pubspec.yaml | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/moor_flutter/CHANGELOG.md b/moor_flutter/CHANGELOG.md index c2eb2612..be5c400f 100644 --- a/moor_flutter/CHANGELOG.md +++ b/moor_flutter/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.1.0 + +- Expose the underlying database from sqflite in `FlutterQueryExecutor`. + This exists only to make migrations to moor easier. + ## 2.0.0 See the changelog of [moor](https://pub.dev/packages/moor#-changelog-tab-) for details, or check out an overview of new features [here](https://moor.simonbinder.eu/v2]) diff --git a/moor_flutter/lib/moor_flutter.dart b/moor_flutter/lib/moor_flutter.dart index f99faa5a..e92846ea 100644 --- a/moor_flutter/lib/moor_flutter.dart +++ b/moor_flutter/lib/moor_flutter.dart @@ -189,7 +189,17 @@ class FlutterQueryExecutor extends DelegatedDatabase { singleInstance: singleInstance, creator: creator), logStatements: logStatements); - /// The underlying sqflite [s.Database] object + /// The underlying sqflite [s.Database] object used by moor to sent queries. + /// + /// Using the sqflite database can cause unexpected behavior in moor. For + /// instance, stream queries won't update for updates sent to the [s.Database] + /// directly. + /// For this reason, projects shouldn't use this getter unless they absolutely + /// need to. The database is exposed to make migrating from sqflite to moor + /// easier. + /// + /// Note that this returns null until the moor database has been opened. + /// A moor database is opened lazily when the first query runs. s.Database get sqfliteDb { final sqfliteDelegate = delegate as _SqfliteDelegate; return sqfliteDelegate.db; diff --git a/moor_flutter/pubspec.yaml b/moor_flutter/pubspec.yaml index 356d1942..48b5ca13 100644 --- a/moor_flutter/pubspec.yaml +++ b/moor_flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: moor_flutter description: Flutter implementation of moor, a safe and reactive persistence library for Dart applications -version: 2.0.0 +version: 2.1.0 repository: https://github.com/simolus3/moor homepage: https://moor.simonbinder.eu/ issue_tracker: https://github.com/simolus3/moor/issues