Skip to main content
Sync Streams do everything Sync Rules do, and more. A stream with 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:
  1. 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: and data: blocks.
  2. 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.
  3. Built-in caching: Each subscription has a configurable ttl that keeps data on the device after unsubscribing. When users return to a screen, the data is often already available.
  4. Framework integration: React hooks, Vue composables, TanStack Query, and Kotlin Compose extensions let UI components manage subscriptions based on what is rendered.
  5. Access to new features: Newer PowerSync Service features such as wildcard schemas and incremental reprocessing require Sync Streams.
You can migrate incrementally. Deploy the generated streams with 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: 3 in your Sync Config

Migration Tool

You can generate a Sync Streams draft from your existing Sync Rules in two ways:
  1. 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.
  2. CLI: Run powersync migrate sync-rules to produce a Sync Streams draft from your current Sync Config.
The output uses 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. Add auto_subscribe: true to maintain the Sync Rules behavior where data syncs automatically on connect. Sync Rules:
Sync Streams:
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:
Sync Streams:

Data with Subqueries (Replaces Parameter Queries)

Sync Rules:
Sync Streams:

Client Parameters → Subscription Parameters

Sync Rules used global Client Parameters:
Sync Streams use Subscription Parameters, which are more flexible — you can subscribe multiple times with different values:

Parameter Syntax Changes

Client-Side Changes

Streams generated by the migration tool with auto_subscribe: true need no client changes. When you convert a stream to on-demand syncing, replace connect-time parameters with a subscription:
If you want to keep passing values at connect time instead, use connection parameters. See Client-Side Usage for detailed examples.