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
4 changes: 2 additions & 2 deletions demos/supabase-todolist/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -551,10 +551,10 @@ packages:
dependency: "direct main"
description:
name: sqlite_async
sha256: "609a8405b8b608ac396dd7f478ed42e230c496eb38fe53dd97e9c592e1cd5cda"
sha256: "139c8f1085132d0941b925efacb4fa0fed9ee40d624739cc26a051dbc36bf727"
url: "https://pub.dev"
source: hosted
version: "0.6.0"
version: "0.6.1"
stack_trace:
dependency: transitive
description:
Expand Down
11 changes: 8 additions & 3 deletions packages/powersync/lib/src/powersync_database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,12 @@ class PowerSyncDatabase with SqliteQueries implements SqliteConnection {
/// The connection is automatically re-opened if it fails for any reason.
///
/// Status changes are reported on [statusStream].
Future<void> connect({required PowerSyncBackendConnector connector}) async {
Future<void> connect(
{required PowerSyncBackendConnector connector,

/// Throttle time between CRUD operations
/// Defaults to 10 milliseconds.
Duration crudThrottleTime = const Duration(milliseconds: 10)}) async {
await initialize();

// Disconnect if connected
Expand Down Expand Up @@ -212,8 +217,8 @@ class PowerSyncDatabase with SqliteQueries implements SqliteConnection {
});
} else if (action == 'init') {
SendPort port = data[1];
var throttled = UpdateNotification.throttleStream(
updates, const Duration(milliseconds: 10));
var throttled =
UpdateNotification.throttleStream(updates, crudThrottleTime);
updateSubscription = throttled.listen((event) {
port.send(['update']);
});
Expand Down