Skip to content
Draft
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
8 changes: 4 additions & 4 deletions demos/benchmarks/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.16.0"
mutex:
dependency: transitive
description:
Expand Down Expand Up @@ -401,10 +401,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
url: "https://pub.dev"
source: hosted
version: "0.7.7"
version: "0.7.6"
typed_data:
dependency: transitive
description:
Expand Down
8 changes: 4 additions & 4 deletions demos/django-todolist/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.16.0"
mutex:
dependency: transitive
description:
Expand Down Expand Up @@ -470,10 +470,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
url: "https://pub.dev"
source: hosted
version: "0.7.7"
version: "0.7.6"
typed_data:
dependency: transitive
description:
Expand Down
8 changes: 4 additions & 4 deletions demos/firebase-nodejs-todolist/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.16.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -654,10 +654,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
url: "https://pub.dev"
source: hosted
version: "0.7.7"
version: "0.7.6"
typed_data:
dependency: transitive
description:
Expand Down
8 changes: 4 additions & 4 deletions demos/supabase-anonymous-auth/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.16.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -598,10 +598,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
url: "https://pub.dev"
source: hosted
version: "0.7.7"
version: "0.7.6"
typed_data:
dependency: transitive
description:
Expand Down
8 changes: 4 additions & 4 deletions demos/supabase-edge-function-auth/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.16.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -598,10 +598,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
url: "https://pub.dev"
source: hosted
version: "0.7.7"
version: "0.7.6"
typed_data:
dependency: transitive
description:
Expand Down
8 changes: 4 additions & 4 deletions demos/supabase-simple-chat/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.16.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -614,10 +614,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
url: "https://pub.dev"
source: hosted
version: "0.7.7"
version: "0.7.6"
timeago:
dependency: "direct main"
description:
Expand Down
8 changes: 4 additions & 4 deletions demos/supabase-todolist-drift/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -604,10 +604,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.16.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -1061,10 +1061,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
url: "https://pub.dev"
source: hosted
version: "0.7.7"
version: "0.7.6"
timing:
dependency: transitive
description:
Expand Down
8 changes: 4 additions & 4 deletions demos/supabase-todolist-optional-sync/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.16.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -694,10 +694,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
url: "https://pub.dev"
source: hosted
version: "0.7.7"
version: "0.7.6"
typed_data:
dependency: transitive
description:
Expand Down
4 changes: 3 additions & 1 deletion demos/supabase-todolist/lib/powersync.dart
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ Future<String> getDatabasePath() async {
return join(dir.path, dbFilename);
}

const options = SyncOptions(syncImplementation: SyncClientImplementation.rust);
const options = SyncOptions(
syncImplementation: SyncClientImplementation.rust,
appMetadata: {'app_version': '1.0.1'});

Future<void> openDatabase() async {
// Open the local database
Expand Down
12 changes: 6 additions & 6 deletions demos/supabase-todolist/macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos

SPEC CHECKSUMS:
app_links: 05a6ec2341985eb05e9f97dc63f5837c39895c3f
app_links: c3185399a5cabc2e610ee5ad52fb7269b84ff869
FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1
path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
powersync-sqlite-core: 42c4a42a692b3b770a5488778789430d67a39b49
powersync_flutter_libs: 19fc6b96ff8155ffea72a08990f6c9f2e712b8a6
shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7
powersync_flutter_libs: 6d1e96884e20082a54b3ceec06939649d038f572
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
sqlite3: 73513155ec6979715d3904ef53a8d68892d4032b
sqlite3_flutter_libs: 83f8e9f5b6554077f1d93119fe20ebaa5f3a9ef1
url_launcher_macos: 0fba8ddabfc33ce0a9afe7c5fef5aab3d8d2d673
sqlite3_flutter_libs: 86f82662868ee26ff3451f73cac9c5fc2a1f57fa
url_launcher_macos: c82c93949963e55b228a30115bd219499a6fe404

PODFILE CHECKSUM: 9ebaf0ce3d369aaa26a9ea0e159195ed94724cf3

Expand Down
23 changes: 8 additions & 15 deletions demos/supabase-todolist/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.16.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -567,13 +567,6 @@ packages:
relative: true
source: path
version: "1.16.1"
powersync_attachments_helper:
dependency: "direct overridden"
description:
path: "../../packages/powersync_attachments_helper"
relative: true
source: path
version: "0.6.20"
powersync_core:
dependency: "direct main"
description:
Expand Down Expand Up @@ -853,26 +846,26 @@ packages:
dependency: "direct dev"
description:
name: test
sha256: "75906bf273541b676716d1ca7627a17e4c4070a3a16272b7a3dc7da3b9f3f6b7"
sha256: "65e29d831719be0591f7b3b1a32a3cda258ec98c58c7b25f7b84241bc31215bb"
url: "https://pub.dev"
source: hosted
version: "1.26.3"
version: "1.26.2"
test_api:
dependency: transitive
description:
name: test_api
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
url: "https://pub.dev"
source: hosted
version: "0.7.7"
version: "0.7.6"
test_core:
dependency: transitive
description:
name: test_core
sha256: "0cc24b5ff94b38d2ae73e1eb43cc302b77964fbf67abad1e296025b78deb53d0"
sha256: "80bf5a02b60af04b09e14f6fe68b921aad119493e26e490deaca5993fef1b05a"
url: "https://pub.dev"
source: hosted
version: "0.6.12"
version: "0.6.11"
typed_data:
dependency: transitive
description:
Expand Down
8 changes: 4 additions & 4 deletions demos/supabase-trello/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.16.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -782,10 +782,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
url: "https://pub.dev"
source: hosted
version: "0.7.7"
version: "0.7.6"
typed_data:
dependency: transitive
description:
Expand Down
12 changes: 12 additions & 0 deletions packages/powersync_core/lib/src/sync/options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import 'package:meta/meta.dart';

/// Options that affect how the sync client connects to the sync service.
final class SyncOptions {
/// A map of application metadata that is passed to the PowerSync service.
///
/// Application metadata that will be displayed in PowerSync service logs.
final Map<String, String>? appMetadata;

/// A JSON object that is passed to the sync service and forwarded to sync
/// rules.
///
Expand Down Expand Up @@ -39,19 +44,22 @@ final class SyncOptions {
this.params,
this.syncImplementation = SyncClientImplementation.defaultClient,
this.includeDefaultStreams,
this.appMetadata,
});

SyncOptions _copyWith({
Duration? crudThrottleTime,
Duration? retryDelay,
Map<String, dynamic>? params,
Map<String, String>? appMetadata,
}) {
return SyncOptions(
crudThrottleTime: crudThrottleTime ?? this.crudThrottleTime,
retryDelay: retryDelay,
params: params ?? this.params,
syncImplementation: syncImplementation,
includeDefaultStreams: includeDefaultStreams,
appMetadata: appMetadata ?? this.appMetadata,
);
}
}
Expand Down Expand Up @@ -89,14 +97,18 @@ extension type ResolvedSyncOptions(SyncOptions source) {
Duration? crudThrottleTime,
Duration? retryDelay,
Map<String, dynamic>? params,
Map<String, String>? appMetadata,
}) {
return ResolvedSyncOptions((source ?? SyncOptions())._copyWith(
crudThrottleTime: crudThrottleTime,
retryDelay: retryDelay,
params: params,
appMetadata: appMetadata,
));
}

Map<String, String> get appMetadata => source.appMetadata ?? const {};

Duration get crudThrottleTime =>
source.crudThrottleTime ?? const Duration(milliseconds: 10);

Expand Down
Loading
Loading