Support cancellations in moor_flutter

This commit is contained in:
Simon Binder 2021-04-01 17:43:23 +02:00
parent cc93fa8238
commit 12ab64a33e
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
4 changed files with 20 additions and 1 deletions

View File

@ -37,6 +37,7 @@ class _SqfliteDelegate extends DatabaseDelegate with _SqfliteExecutor {
});
DbVersionDelegate? _delegate;
@override
DbVersionDelegate get versionDelegate {
return _delegate ??= _SqfliteVersionDelegate(db);
@ -219,4 +220,11 @@ class EncryptedExecutor extends DelegatedDatabase {
final sqfliteDelegate = delegate as _SqfliteDelegate;
return sqfliteDelegate.isOpen ? sqfliteDelegate.db : null;
}
@override
// We're not really required to be sequential since sqflite has an internal
// lock to bring statements into a sequential order.
// Setting isSequential here helps with moor cancellations in stream queries
// though.
bool get isSequential => true;
}

View File

@ -1,3 +1,7 @@
## 4.1.0-dev
- Support query cancellations introduced in moor 4.3.0
## 4.0.0
- Support moor version 4

View File

@ -206,4 +206,11 @@ class FlutterQueryExecutor extends DelegatedDatabase {
final sqfliteDelegate = delegate as _SqfliteDelegate;
return sqfliteDelegate.isOpen ? sqfliteDelegate.db : null;
}
@override
// We're not really required to be sequential since sqflite has an internal
// lock to bring statements into a sequential order.
// Setting isSequential here helps with moor cancellations in stream queries
// though.
bool get isSequential => true;
}

View File

@ -1,6 +1,6 @@
name: moor_flutter
description: Flutter implementation of moor, a safe and reactive persistence library for Dart applications
version: 4.0.0
version: 4.1.0-dev
repository: https://github.com/simolus3/moor
homepage: https://moor.simonbinder.eu/
issue_tracker: https://github.com/simolus3/moor/issues