Skip to content

WIP: Add sync implementation from core extension #192

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 12 commits into
base: main
Choose a base branch
from

Conversation

simolus3
Copy link
Contributor

@simolus3 simolus3 commented May 8, 2025

This integrates the new sync logic implemented in the core extension (at powersync-ja/powersync-sqlite-core#70) into the Kotlin SDK.

Internally, the existing implementation has been renamed to "legacy implementation" (and I've annotated methods related to it with @LegacySyncImplementation which should make it easier to identify which methods we can eventually remove after we finish the migration).
For now however, the new implementation is marked as experimental, and not enabled by default. Users will have to use Kotlin's opt-in mechanism for ExperimentalPowerSyncAPI to use it. So, the only API changes are:

  • Adding the SyncOptions class. Constructing a non-default instance of this class requires opting in to ExperimentalPowerSyncAPI.
    • On that class, a newClientImplementation field can be set to true to use the new Rust client.
    • Similarly, method can be set to ConnectionMethod.Http or to ConnectionMethod.WebSocket.

In the sync stream, I've moved the existing methods into an inner LegacyIteration class, the new ActiveIteration class implements the sync logic by forwarding it to the PowerSync control interface in the core extension.

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