mirror of https://github.com/AMT-Cheif/drift.git
Merge branch 'master' of gh:simolus3/moor
This commit is contained in:
commit
d0a969e9cc
|
@ -37,7 +37,7 @@ class TodoDb extends _$TodoDb {
|
||||||
|
|
||||||
With the database class ready, let's open it on a background isolate
|
With the database class ready, let's open it on a background isolate
|
||||||
```dart
|
```dart
|
||||||
import 'package:moor/isolates.dart';
|
import 'package:moor/isolate.dart';
|
||||||
|
|
||||||
// This needs to be a top-level method because it's run on a background isolate
|
// This needs to be a top-level method because it's run on a background isolate
|
||||||
DatabaseConnection _backgroundConnection() {
|
DatabaseConnection _backgroundConnection() {
|
||||||
|
@ -171,4 +171,4 @@ Internally, moor uses the following model to implement this api:
|
||||||
The client acts as a moor backend, which means that all queries are built on the client isolate. The
|
The client acts as a moor backend, which means that all queries are built on the client isolate. The
|
||||||
raw sql string and parameters are then sent to the server isolate, which will enqueue the operation
|
raw sql string and parameters are then sent to the server isolate, which will enqueue the operation
|
||||||
and execute it eventually. Implementing the isolate commands at a low level allows users to re-use
|
and execute it eventually. Implementing the isolate commands at a low level allows users to re-use
|
||||||
all their code used without the isolate api.
|
all their code used without the isolate api.
|
||||||
|
|
|
@ -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
|
## 2.0.0
|
||||||
See the changelog of [moor](https://pub.dev/packages/moor#-changelog-tab-) for details,
|
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])
|
or check out an overview of new features [here](https://moor.simonbinder.eu/v2])
|
||||||
|
|
|
@ -188,4 +188,20 @@ class FlutterQueryExecutor extends DelegatedDatabase {
|
||||||
_SqfliteDelegate(true, path,
|
_SqfliteDelegate(true, path,
|
||||||
singleInstance: singleInstance, creator: creator),
|
singleInstance: singleInstance, creator: creator),
|
||||||
logStatements: logStatements);
|
logStatements: logStatements);
|
||||||
|
|
||||||
|
/// The underlying sqflite [s.Database] object used by moor to send 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name: moor_flutter
|
name: moor_flutter
|
||||||
description: Flutter implementation of moor, a safe and reactive persistence library for Dart applications
|
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
|
repository: https://github.com/simolus3/moor
|
||||||
homepage: https://moor.simonbinder.eu/
|
homepage: https://moor.simonbinder.eu/
|
||||||
issue_tracker: https://github.com/simolus3/moor/issues
|
issue_tracker: https://github.com/simolus3/moor/issues
|
||||||
|
|
Loading…
Reference in New Issue