Skip to content

Commit ae79a3e

Browse files
committed
Support build_web_compilers
1 parent f5eb871 commit ae79a3e

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

packages/powersync_core/lib/src/open_factory/abstract_powersync_open_factory.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'dart:async';
2-
import 'package:universal_io/io.dart';
32
import 'dart:math';
43

4+
import 'package:meta/meta.dart';
55
import 'package:powersync_core/sqlite_async.dart';
66
import 'package:powersync_core/src/open_factory/common_db_functions.dart';
77
import '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.

packages/powersync_core/lib/src/open_factory/native/native_open_factory.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
import 'dart:io';
2+
import 'dart:io' as io;
13
import 'dart:ffi';
24

35
import 'package:powersync_core/src/exceptions.dart';
46
import 'package:powersync_core/src/log.dart';
5-
import 'package:universal_io/io.dart';
67
import 'dart:isolate';
78
import 'package:powersync_core/src/open_factory/abstract_powersync_open_factory.dart';
89
import '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
}

packages/powersync_core/pubspec.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)