File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed
packages/sqlite_async/lib Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ class WebDatabase
2626 closed = true ;
2727 }
2828
29+ @override
30+ Future <void > get closedFuture => _database.closed;
31+
2932 @override
3033 Future <bool > getAutoCommit () async {
3134 final response = await _database.customRequest (
Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ class SqliteDatabaseImpl
2424 return _connection.closed;
2525 }
2626
27+ @override
28+ Future <void > get closedFuture => _connection.closedFuture;
29+
2730 final StreamController <UpdateNotification > updatesController =
2831 StreamController .broadcast ();
2932
Original file line number Diff line number Diff line change @@ -32,6 +32,13 @@ typedef WebDatabaseEndpoint = ({
3232/// opened database across different JavaScript contexts
3333/// (e.g. document windows and workers).
3434abstract class WebSqliteConnection implements SqliteConnection {
35+ /// Returns a future that completes when this connection is closed.
36+ ///
37+ /// This usually only happens when calling [close] , but on the web
38+ /// specifically, it can also happen when a remote context closes a database
39+ /// accessed via [connectToEndpoint] .
40+ Future <void > get closedFuture;
41+
3542 /// Returns a [WebDatabaseEndpoint] - a structure that consists only of types
3643 /// that can be transferred across a [MessagePort] in JavaScript.
3744 ///
You can’t perform that action at this time.
0 commit comments