Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/powersync/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
flutter:
sdk: flutter

sqlite3_flutter_libs: ^0.5.23
sqlite3_flutter_libs: ^0.5.39
powersync_core: ^1.5.2
powersync_flutter_libs: ^0.4.11
collection: ^1.17.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:async';
import 'package:universal_io/io.dart';
import 'dart:math';

import 'package:meta/meta.dart';
import 'package:powersync_core/sqlite_async.dart';
import 'package:powersync_core/src/open_factory/common_db_functions.dart';
import 'package:sqlite_async/sqlite3_common.dart';
Expand Down Expand Up @@ -70,6 +70,11 @@ abstract class AbstractPowerSyncOpenFactory extends DefaultSqliteOpenFactory {
/// Returns the library name for the current platform.
/// [path] is optional and is used when the library is not in the default location.
String getLibraryForPlatform({String? path});

/// On native platforms, synchronously pauses the current isolate for the
/// given [Duration].
@visibleForOverriding
void sleep(Duration duration) {}
}

/// Advanced: Define custom setup for each SQLite connection.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import 'dart:io';
import 'dart:io' as io;
import 'dart:ffi';

import 'package:powersync_core/src/exceptions.dart';
import 'package:powersync_core/src/log.dart';
import 'package:universal_io/io.dart';
import 'dart:isolate';
import 'package:powersync_core/src/open_factory/abstract_powersync_open_factory.dart';
import 'package:sqlite_async/sqlite3.dart' as sqlite;
Expand Down Expand Up @@ -109,4 +110,9 @@ class PowerSyncOpenFactory extends AbstractPowerSyncOpenFactory {
);
}
}

@override
void sleep(Duration duration) {
io.sleep(duration);
}
}
1 change: 0 additions & 1 deletion packages/powersync_core/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies:
sqlite3: ^2.4.6
# We implement a database controller, which is an interface of sqlite3_web.
sqlite3_web: ^0.3.2
universal_io: ^2.0.0
meta: ^1.0.0
http: ^1.5.0
uuid: ^4.2.0
Expand Down