PowerSync is a sync engine for building local-first apps with instantly-responsive UI/UX and simplified state transfer. Syncs between SQLite on the client-side and Postgres, MongoDB, MySQL or SQL Server on the server-side.
Note
This SDK is currently in an alpha state, intended for external testing and public feedback. Expect breaking changes and instability as development continues.
This repository contains code used to build a PowerSync SDK for native development.
PowerSync is available as a Rust crate in powersync/, and on crates.io as the powersync crate.
To start an example:
- Run the NodeJS demo without
the sync service:
docker compose up --scale powersync=0 - Start a sync service instance with sync streams configured (see sync rules below).
- Compile and run an example here:
cargo run -p egui_todolist.
# Sync-rule docs: https://docs.powersync.com/usage/sync-rules
streams:
lists:
query: SELECT * FROM lists #WHERE owner_id = auth.user_id()
auto_subscribe: true
todos:
query: SELECT * FROM todos WHERE list_id = subscription.parameter('list') #AND list_id IN (SELECT id FROM lists WHERE owner_id = auth.user_id())
config:
edition: 2