Skip to content

WIP: Option to use core exension for sync logic #283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

simolus3
Copy link
Contributor

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 new SyncClientImplementation.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 use SyncClientImplementation.defaultClient instead, which we can eventually point to SyncClientImplementation.rust).

The new implementation based on the core extension follows the same pattern used in our other SDKs: We send start to powersync_control, receive an instruction to start syncing and then forward sync lines into the extension. I'm running the in_memory_sync_tests 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant