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 or MySQL on the server-side.
Caution
The PowerSync Rust SDK is currently experimental and in a pre-alpha state. We offer no stability guarantees for this SDK, and can't guarantee continued support for it. If you're interested in using this, please reach out!
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