-
Notifications
You must be signed in to change notification settings - Fork 0
[POC] PowerSync Integration #1
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
base: main
Are you sure you want to change the base?
Conversation
"module": "dist/esm/index.js", | ||
"packageManager": "pnpm@10.17.0", | ||
"author": "JOURNEYAPPS", | ||
"license": "Apache-2.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might need to match the other packages in this repo's license (MIT)
"@powersync/common": "^1.39.0" | ||
}, | ||
"devDependencies": { | ||
"@powersync/common": "0.0.0-dev-20251003085035", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is currently using a dev version that does not require Better-SQLite3
or install scripts for downloading the PowerSync Rust core extension. Removing the requirement for install scripts makes running the tests easier.
This dev version requirement is only for unit tests.
This can use the latest version once these have been merged:
🎯 Changes
This PR adds a PowerSync integration for TanStack DB collections. This PR is just a temporary internal PR for discussion. Ideally, a PR would be made upstream after internal discussion.
There are multiple options for integrating PowerSync with TanStack DB collections. The main options are to either:
The work here investigates and implements
1
, while2
can be implemented in a different PR.The PowerSync SDK is used for both syncing data to local SQLite tables as well as perform uploads via the
PowerSyncBackendConnector
.TanStack DB collections are tied to the local SQLite tables with the help of collection builders. These collection builders link the TanStack collection state to the SQLite table via Trigger based diff tracking. Mutations made on TanStack DB collections are persisted to SQLite via
PowerSyncTransactor
, once persisted the upload queue ensures changes are uploaded to a backend.Detailed examples are in the unit tests. The main flow is to:
Create a PowerSync SDK Client
Define TanStack DB collections using the database
Use the TanStack DB collections as one would any other collection
✅ Checklist
PowerSync TODOs
Test Schema support
Add documentation
The Node.js SDK requires install scripts which don't run automatically - breaks tests
I have followed the steps in the Contributing guide (Seems like a dead link, the repo also does not seem to have a CONTRIBUTING.md file)
I have tested this code locally with
pnpm test:pr
(There does not seem to be a script for this)🚀 Release Impact
This change is docs/CI/dev-only (no release).