Skip to content

[Drift] Wildcard schema support added to Sync Streams FROM clause (powersync-service #703) #540

Description

@benitav

What's changing: Sync Streams now support a wildcard schema in the FROM clause (e.g. FROM "%".assets), together with new schema(), table_suffix(), and table_name() functions that resolve per-client from the source row. This lets a single stream span every matching Postgres schema, enabling schema-per-tenant replication (one schema per tenant) from a single replication slot without a per-tenant sync-config change.

High priority — existing docs are now inaccurate or incomplete
None identified. Filing under the waiver: the hard precondition is not met (no existing page becomes wrong or misleading), but this is a meaningful new capability with no current doc coverage, and the source PR carries the team's "Product Visibility" label.

For reviewer consideration — may be worth documenting

  • Supported SQL guide (https://docs.powersync.com/sync/supported-sql) — the FROM clause is currently only described with plain table names (e.g. FROM users, FROM comments INNER JOIN issues ON ...). There's no mention of schema-qualified sources, wildcard schemas, or the new schema()/table_suffix()/table_name() functions anywhere on this page.
  • Grammar Reference (Sync Streams) (https://docs.powersync.com/sync/grammar/sync-streams/index) — the TableSource rule is defined as a bare identifier only (example: users AS u), with no schema qualification. This formal grammar reference doesn't yet reflect the new qualified-schema syntax or the three new functions.
  • Partitioned Tables (Postgres) (https://docs.powersync.com/sync/advanced/partitioned-tables) — this page already documents wildcard suffix matching on table names (e.g. "users_%") and a _table_suffix special column, a different mechanism (table-name wildcarding, not schema wildcarding). The new table_suffix() function operates on schema-wildcard sources. Worth a reviewer's judgment on whether the similar naming needs disambiguating if/when this is documented.
  • Per the PR discussion, a literal "%" schema name previously only matched a schema literally named % (i.e. matched nothing in practice); it now matches any schema. This is shared with the older Sync Rules compiler via TablePattern.matches(), though the new schema()/table_suffix()/table_name() functions are Sync Streams edition-3 only.
  • A follow-on PR (powersync-service#717, open as of filing) introduces sync plan version 2 to support this feature's serialized plan changes, gated so existing deployments not using the new functions are unaffected.

Source PR: powersync-ja/powersync-service#703 — merged 2026-07-15.

Filed automatically by Claude Code (claude-sonnet-5). A human must verify the scope, prepare the docs PR, and publish it only once this update has been released.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions