auto_subscribe: true syncs when the client connects, the same way a bucket definition does, so apps that sync all relevant data upfront for offline use keep working the same way after migrating. The migration tool sets auto_subscribe: true on every generated stream, so no client-side changes are required when you first deploy.
Why Migrate?
Beyond matching Sync Rules, Sync Streams add:-
More expressive queries: Stream queries support JOINs, CTEs, subqueries, and multiple queries per stream, with syntax closer to plain SQL. Parameter queries become inline subqueries, so you write one query instead of separate
parameters:anddata:blocks. - On-demand syncing: Define a stream once, then subscribe from your app one or more times with different parameters. Each subscription has its own lifecycle, so two screens or browser tabs can subscribe to the same stream independently. With Sync Rules, Client Parameters approximate this, but you have to aggregate the parameter values yourself across screens and tabs, and remove them when they are no longer needed.
-
Built-in caching: Each subscription has a configurable
ttlthat keeps data on the device after unsubscribing. When users return to a screen, the data is often already available. - Framework integration: React hooks, Vue composables, TanStack Query, and Kotlin Compose extensions let UI components manage subscriptions based on what is rendered.
- Access to new features: Newer PowerSync Service features such as wildcard schemas and incremental reprocessing require Sync Streams.
auto_subscribe: true first, then convert individual streams to on-demand subscriptions where that benefits your app.
Requirements
- PowerSync Service v1.20.0+ (Cloud instances already meet this)
- Latest SDK versions with Rust-based sync client (enabled by default on latest SDKs)
config: edition: 3in your Sync Config
- Minimum SDK Versions
- Enable Rust Client (older SDKs)
Migration Tool
You can generate a Sync Streams draft from your existing Sync Rules in two ways:- Dashboard: In the PowerSync Dashboard, use the Migrate to Sync Streams button. It converts your Sync Rules into a Sync Streams draft that you can review before deploying.
-
CLI: Run
powersync migrate sync-rulesto produce a Sync Streams draft from your current Sync Config.
auto_subscribe: true by default, preserving your existing sync-everything-upfront behavior so no client-side changes are required when you first deploy.
Next steps: Review the draft, then deploy it (via the Dashboard or powersync deploy sync-config). After that, you can optionally migrate individual streams to on-demand subscriptions over time — remove auto_subscribe: true from specific streams and update client code to use the syncStream() API where it makes sense for your app.
Stream Definition Reference
Migration Examples
Global Data (No Parameters)
In Sync Rules, a “global” bucket syncs the same data to all users. In Sync Streams, you achieve this with queries that have no parameters. Addauto_subscribe: true to maintain the Sync Rules behavior where data syncs automatically on connect.
Sync Rules:
Without
auto_subscribe: true, clients would need to explicitly subscribe to these streams. This gives you flexibility to migrate incrementally or switch to on-demand syncing later.User-Scoped Data
Sync Rules:Data with Subqueries (Replaces Parameter Queries)
Sync Rules:Client Parameters → Subscription Parameters
Sync Rules used global Client Parameters:Parameter Syntax Changes
Client-Side Changes
Streams generated by the migration tool withauto_subscribe: true need no client changes. When you convert a stream to on-demand syncing, replace connect-time parameters with a subscription: