WIP: Option to use core exension for sync logic #283
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This depends on powersync-ja/powersync-sqlite-core#70
This adds the
SyncOptions.syncImplementation
field to control which implementation is used for parsing and applying lines received from the sync service: Two options are available:SyncClientImplementation.dart
(the existing implementation) and a newSyncClientImplementation.rust
. For now,dart
is still the default implementation. To allow us to eventually remove the Dart-based implementation without a breaking change,SyncClientImplementation.dart
is already marked as deprecated (users should useSyncClientImplementation.defaultClient
instead, which we can eventually point toSyncClientImplementation.rust
).The new implementation based on the core extension follows the same pattern used in our other SDKs: We send
start
topowersync_control
, receive an instruction to start syncing and then forward sync lines into the extension. I'm running thein_memory_sync_test
s with both implementations now, since that test file is testing most of the sync logic.This PR only supports JSON / HTTP streams as a way to receive sync lines - I'll open a follow-up PR adding RSocket support.