File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 11import 'dart:async' ;
2- import 'package:universal_io/io.dart' ;
32import 'dart:math' ;
43
4+ import 'package:meta/meta.dart' ;
55import 'package:powersync_core/sqlite_async.dart' ;
66import 'package:powersync_core/src/open_factory/common_db_functions.dart' ;
77import 'package:sqlite_async/sqlite3_common.dart' ;
@@ -70,6 +70,11 @@ abstract class AbstractPowerSyncOpenFactory extends DefaultSqliteOpenFactory {
7070 /// Returns the library name for the current platform.
7171 /// [path] is optional and is used when the library is not in the default location.
7272 String getLibraryForPlatform ({String ? path});
73+
74+ /// On native platforms, synchronously pauses the current isolate for the
75+ /// given [Duration] .
76+ @visibleForOverriding
77+ void sleep (Duration duration) {}
7378}
7479
7580/// Advanced: Define custom setup for each SQLite connection.
Original file line number Diff line number Diff line change 1+ import 'dart:io' ;
2+ import 'dart:io' as io;
13import 'dart:ffi' ;
24
35import 'package:powersync_core/src/exceptions.dart' ;
46import 'package:powersync_core/src/log.dart' ;
5- import 'package:universal_io/io.dart' ;
67import 'dart:isolate' ;
78import 'package:powersync_core/src/open_factory/abstract_powersync_open_factory.dart' ;
89import 'package:sqlite_async/sqlite3.dart' as sqlite;
@@ -109,4 +110,9 @@ class PowerSyncOpenFactory extends AbstractPowerSyncOpenFactory {
109110 );
110111 }
111112 }
113+
114+ @override
115+ void sleep (Duration duration) {
116+ io.sleep (duration);
117+ }
112118}
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ dependencies:
1414 sqlite3 : ^2.4.6
1515 # We implement a database controller, which is an interface of sqlite3_web.
1616 sqlite3_web : ^0.3.2
17- universal_io : ^2.0.0
1817 meta : ^1.0.0
1918 http : ^1.5.0
2019 uuid : ^4.2.0
You can’t perform that action at this time.
0 commit comments