@@ -10,12 +10,15 @@ import 'package:sqlite_async/src/sqlite_options.dart';
1010import 'package:sqlite_async/src/update_notification.dart' ;
1111import 'package:sqlite_async/src/web/web_mutex.dart' ;
1212import 'package:sqlite_async/src/web/web_sqlite_open_factory.dart' ;
13+ import 'package:sqlite_async/web.dart' ;
14+
15+ import '../database.dart' ;
1316
1417/// Web implementation of [SqliteDatabase]
1518/// Uses a web worker for SQLite connection
1619class SqliteDatabaseImpl
1720 with SqliteQueries , SqliteDatabaseMixin
18- implements SqliteDatabase {
21+ implements SqliteDatabase , WebSqliteConnection {
1922 @override
2023 bool get closed {
2124 return _connection.closed;
@@ -38,7 +41,7 @@ class SqliteDatabaseImpl
3841 AbstractDefaultSqliteOpenFactory openFactory;
3942
4043 late final Mutex mutex;
41- late final SqliteConnection _connection;
44+ late final WebDatabase _connection;
4245
4346 /// Open a SqliteDatabase.
4447 ///
@@ -78,8 +81,8 @@ class SqliteDatabaseImpl
7881
7982 Future <void > _init () async {
8083 _connection = await openFactory.openConnection (SqliteOpenOptions (
81- primaryConnection: true , readOnly: false , mutex: mutex));
82- _connection.updates! .forEach ((update) {
84+ primaryConnection: true , readOnly: false , mutex: mutex)) as WebDatabase ;
85+ _connection.updates.forEach ((update) {
8386 updatesController.add (update);
8487 });
8588 }
@@ -139,4 +142,9 @@ class SqliteDatabaseImpl
139142 await isInitialized;
140143 return _connection.getAutoCommit ();
141144 }
145+
146+ @override
147+ Future <WebDatabaseEndpoint > exposeEndpoint () async {
148+ return await _connection.exposeEndpoint ();
149+ }
142150}
0 commit comments