Skip to content
Open
2 changes: 1 addition & 1 deletion architecture/consistency.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ While mutations are present in the upload queue, the client does not advance to
Only once all the client-side mutations have been acknowledged by the server, and the data for that new checkpoint is downloaded by the client, does the client advance to the next checkpoint. This ensures that the operations are always ordered correctly on the client.

<Note>
There is one nuanced case here, which is buckets with [Priority 0](/sync/advanced/prioritized-sync#special-case-priority-0) if you are using [Prioritized Syncing](/sync/advanced/prioritized-sync).
There is one nuanced case here, which is buckets with [Priority 0](/sync/streams/prioritized-sync#special-case-priority-0) if you are using [Prioritized Syncing](/sync/streams/prioritized-sync).
</Note>

## Types of Client-Side Mutations/Operations
Expand Down
2 changes: 1 addition & 1 deletion client-sdks/advanced/raw-tables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ Raw tables support advanced table constraints including foreign keys. When enabl

1. While PowerSync will always apply synced data in a transaction, there is no way to control the order in which rows get applied.
For this reason, foreign keys need to be configured with `DEFERRABLE INITIALLY DEFERRED`.
2. When using [stream priorities](/sync/advanced/prioritized-sync), you need to ensure you don't have foreign keys from high-priority
2. When using [stream priorities](/sync/streams/prioritized-sync), you need to ensure you don't have foreign keys from high-priority
rows to lower-priority data. PowerSync applies data in one transaction per priority, so these foreign keys would not work.
3. As usual when using foreign keys, note that they need to be explicitly enabled with `pragma foreign_keys = on`.

Expand Down
2 changes: 1 addition & 1 deletion configuration/app-backend/client-side-integration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ After you've [instantiated](/intro/setup-guide#instantiate-the-powersync-databas

| Purpose | Description |
|---------|-------------|
| **Uploading mutations to your backend:** | Mutations that are made to the client-side SQLite database are uploaded to your backend application, where you control how they're applied to your backend source database (Postgres, MongoDB, MySQL, SQL Server, or Convex). This is how PowerSync achieves bi-directional syncing of data: The [PowerSync Service](/architecture/powersync-service) provides the _server-to-client read path_ based on your [Sync Streams or Sync Rules (legacy)](/sync/overview), and the _client-to-server write path_ goes via your backend. |
| **Uploading mutations to your backend:** | Mutations that are made to the client-side SQLite database are uploaded to your backend application, where you control how they're applied to your backend source database (Postgres, MongoDB, MySQL, SQL Server, or Convex). This is how PowerSync achieves bi-directional syncing of data: The [PowerSync Service](/architecture/powersync-service) provides the _server-to-client read path_ based on your [Sync Streams](/sync/streams/overview) (or legacy [Sync Rules](/sync/rules/overview)), and the _client-to-server write path_ goes via your backend. |
| **Authentication integration:** (optional) | PowerSync uses JWTs for authentication between the Client SDK and PowerSync Service. Some [authentication providers](/configuration/auth/overview#common-authentication-providers) generate JWTs for users which PowerSync can verify directly. For others, some code must be [added to your application backend](/configuration/auth/custom) to generate the JWTs. |


Expand Down
2 changes: 1 addition & 1 deletion configuration/source-db/postgres-maintenance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: "Manage Postgres replication slots and WAL lag for reliable PowerSy

Postgres logical replication slots are used to keep track of [replication](/architecture/powersync-service#replication-from-the-source-database) progress (recorded as a [LSN](https://www.postgresql.org/docs/current/datatype-pg-lsn.html)).

Every time a new version of [Sync Streams or Sync Rules](/sync/overview) is deployed, PowerSync creates a new replication slot. Once the new version is fully processed, PowerSync switches to use the new slot and deletes the old one. The Service logs these steps and, during a snapshot, how much WAL budget remains. See [Postgres Replication Slots and WAL Budget](/debugging/log-reference#postgres-replication-slots-and-wal-budget) in the Log Reference.
Every time a new version of [Sync Streams](/sync/streams/overview) (or legacy [Sync Rules](/sync/rules/overview)) is deployed, PowerSync creates a new replication slot. Once the new version is fully processed, PowerSync switches to use the new slot and deletes the old one. The Service logs these steps and, during a snapshot, how much WAL budget remains. See [Postgres Replication Slots and WAL Budget](/debugging/log-reference#postgres-replication-slots-and-wal-budget) in the Log Reference.

The replication slots can be viewed using this query:

Expand Down
2 changes: 1 addition & 1 deletion debugging/error-codes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@

This reference documents PowerSync error codes organized by component, with troubleshooting suggestions for developers. Use the search bar to look up specific error codes (e.g., `PSYNC_R0001`).

## PSYNC_Rxxxx: Sync Config issues

Check warning on line 9 in debugging/error-codes.mdx

View check run for this annotation

Mintlify / Mintlify Validation (powersync) - vale-spellcheck

debugging/error-codes.mdx#L9

Did you really mean 'PSYNC_Rxxxx'?

- **PSYNC_R0001**:
Catch-all [Sync Config](/sync/overview) parsing error, if no more specific error is available
Catch-all [Sync Config](/sync/streams/quickstart#defining-streams) parsing error, if no more specific error is available
Comment thread
benitav marked this conversation as resolved.

- **PSYNC_R2201**:
A table or schema wildcard (`%`) is not supported by the configured source connector.

Wildcard support is connector-specific. For example, SQL Server requires exact table and schema names, while some other connectors support table wildcards but not schema wildcards.

## PSYNC_Sxxxx: Service issues

Check warning on line 19 in debugging/error-codes.mdx

View check run for this annotation

Mintlify / Mintlify Validation (powersync) - vale-spellcheck

debugging/error-codes.mdx#L19

Did you really mean 'PSYNC_Sxxxx'?

- **PSYNC_S0001**:
Internal assertion.
Expand Down
2 changes: 1 addition & 1 deletion debugging/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,6 @@
#### Common Causes of Latency

* **Large initial sync**: if your Sync Streams/Rules result in a large dataset, the first sync after connecting will be slow. Inspect bucket sizes and sync state with the [Sync Diagnostics Client](/tools/diagnostics-client).
* **Upload queue blocking downloads**: by default, uploads are processed before downloads, so a backlogged upload queue delays receiving new data. Buckets and streams at [priority 0](/sync/advanced/prioritized-sync) are not blocked by uploads, but come with the trade-off of potential sync inconsistencies.
* **Upload queue blocking downloads**: by default, uploads are processed before downloads, so a backlogged upload queue delays receiving new data. Buckets and streams at [priority 0](/sync/streams/prioritized-sync) are not blocked by uploads, but come with the trade-off of potential sync inconsistencies.
* **Replication lag on the source database**: high write volume, long-running transactions, bulk updates, or backfills can cause replication to fall behind faster than the service can drain it. See [Replication Lag](/maintenance-ops/replication-lag) for source-specific causes and fixes.

Check warning on line 135 in debugging/troubleshooting.mdx

View check run for this annotation

Mintlify / Mintlify Validation (powersync) - vale-spellcheck

debugging/troubleshooting.mdx#L135

Did you really mean 'backfills'?
* **Too many buckets per user**: incremental sync overhead scales roughly linearly with the number of buckets per user. See [Too Many Buckets](#psync_s2305-too-many-buckets-/-parameter-query-results) above.
60 changes: 36 additions & 24 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,50 +183,36 @@
]
},
{
"group": "Sync Streams & Rules",
"group": "Sync Streams",
"icon": "arrows-rotate",
"pages": [
"sync/overview",
"sync/streams/overview",
"sync/streams/quickstart",
{
"group": "Sync Streams",
"group": "Usage",
"pages": [
"sync/streams/overview",
"sync/streams/parameters",
"sync/streams/queries",
"sync/streams/parameters",
"sync/streams/ctes",
"sync/streams/bucket-count",
"sync/streams/examples",
"sync/streams/client-usage",
"sync/streams/migration"
"sync/streams/prioritized-sync",
"sync/streams/examples"
]
},
{
"group": "Sync Rules (Legacy)",
"pages": [
"sync/rules/overview",
"sync/rules/organize-data-into-buckets",
"sync/rules/global-buckets",
"sync/rules/parameter-queries",
"sync/rules/data-queries",
"sync/rules/many-to-many-join-tables",
"sync/rules/client-parameters"
]
},
"sync/types",
{
"group": "Supported SQL",
"group": "Reference",
"pages": [
"sync/supported-sql",
"sync/grammar/sync-streams/index",
"sync/grammar/sync-rules/index"
"sync/types"
]
},
{
"group": "Advanced",
"pages": [
"sync/advanced/overview",
"sync/advanced/reducing-bucket-count",
"sync/advanced/prioritized-sync",
"sync/advanced/client-id",
"sync/advanced/case-sensitivity",
"sync/advanced/compatibility",
Expand All @@ -237,6 +223,20 @@
"sync/advanced/partitioned-tables",
"sync/advanced/sharded-databases"
]
},
{
"group": "Sync Rules (Legacy)",
"pages": [
"sync/rules/migrate-to-sync-streams",
"sync/rules/overview",
"sync/rules/organize-data-into-buckets",
"sync/rules/global-buckets",
"sync/rules/parameter-queries",
"sync/rules/data-queries",
"sync/rules/many-to-many-join-tables",
"sync/rules/client-parameters",
"sync/grammar/sync-rules/index"
]
}
]
},
Expand Down Expand Up @@ -784,6 +784,14 @@
"source": "/usage/sync-streams",
"destination": "/sync/streams/overview"
},
{
"source": "/sync/overview",
"destination": "/sync/streams/overview"
},
{
"source": "/sync/streams/migration",
"destination": "/sync/rules/migrate-to-sync-streams"
},
{
"source": "/usage/sync-rules/types",
"destination": "/sync/types"
Expand All @@ -802,7 +810,11 @@
},
{
"source": "/usage/use-case-examples/prioritized-sync",
"destination": "/sync/advanced/prioritized-sync"
"destination": "/sync/streams/prioritized-sync"
},
{
"source": "/sync/advanced/prioritized-sync",
"destination": "/sync/streams/prioritized-sync"
},
{
"source": "/usage/sync-rules/client-id",
Expand Down
2 changes: 1 addition & 1 deletion snippets/binary-type.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<Note>
Binary data can be accessed in the Sync Streams / Sync Rules, but cannot be used as [parameters](/sync/overview#how-it-works). To sync binary columns/fields to clients, those columns need to be converted to hex or base64 representation using the relevant [functions](/sync/supported-sql#functions).
Binary data can be accessed in Sync Streams (or legacy Sync Rules), but cannot be used as a parameter (see [Sync Streams parameters](/sync/streams/parameters) or [Sync Rules client parameters](/sync/rules/client-parameters)). To sync binary columns/fields to clients, those columns need to be converted to hex or base64 representation using the relevant [functions](/sync/supported-sql#functions).
Comment thread
benitav marked this conversation as resolved.
</Note>
2 changes: 1 addition & 1 deletion snippets/stream-definition-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ streams:
| `queries` | — | Array of queries defining which data to sync. More efficient than defining separate streams: the client manages one subscription and PowerSync merges the data from all queries (see [Multiple Queries per Stream](/sync/streams/queries#multiple-queries-per-stream)). |
| `with` | — | [CTEs](/sync/streams/ctes) available to this stream's queries. Define the `with` block inside each stream. |
| `auto_subscribe` | `false` | When `true`, clients automatically subscribe on connect. |
| `priority` | — | Sync priority (lower value = higher priority). See [Prioritized Sync](/sync/advanced/prioritized-sync). |
| `priority` | — | Sync priority (lower value = higher priority). See [Prioritized Sync](/sync/streams/prioritized-sync). |
| `accept_potentially_dangerous_queries` | `false` | Silences security warnings when queries use client-controlled parameters (i.e. _connection parameters_ and _subscription parameters_), as opposed to _authentication parameters_ that are signed as part of the JWT. Set to `true` only if you've verified the query is safe. See [Using Parameters](/sync/streams/parameters). |
6 changes: 4 additions & 2 deletions sync/advanced/overview.mdx
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
---
title: "Advanced Topics"
description: "Advanced Sync Streams and Sync Rules topics."
description: "Sync Streams topics you only need when a specific condition applies to your data, source database, or deployment."
sidebarTitle: Overview
---

These pages cover situations that do not apply to every project. Use them when a specific condition applies to your data, source database, or deployment. For pages that every project needs, see [Writing Queries](/sync/streams/queries) and the other Usage pages.

<CardGroup>
<Card title="Reducing Bucket Count" icon="chart-line-down" href="/sync/advanced/reducing-bucket-count" horizontal/>
<Card title="Prioritized Sync" icon="arrow-down-1-9" href="/sync/advanced/prioritized-sync" horizontal/>
<Card title="Client ID" icon="key" href="/sync/advanced/client-id" horizontal/>
<Card title="Case Sensitivity" icon="font-case" href="/sync/advanced/case-sensitivity" horizontal/>
<Card title="Compatibility" icon="code-merge" href="/sync/advanced/compatibility" horizontal/>
<Card title="Storage Version 4" icon="hard-drive" href="/sync/advanced/storage-version-4" horizontal/>
<Card title="Sync Data by Time" icon="clock" href="/sync/advanced/sync-data-by-time" horizontal/>
<Card title="Schemas and Connections" icon="database" href="/sync/advanced/schemas-and-connections" horizontal/>
<Card title="Multiple Client Versions" icon="code-branch" href="/sync/advanced/multiple-client-versions" horizontal/>
Expand Down
2 changes: 1 addition & 1 deletion sync/advanced/storage-version-4.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The PowerSync Cloud and self-hosted columns below apply during the Beta only. On
| Incremental reprocessing | MongoDB | Sync Streams | Included with version 4 | Included with version 4 |
| S3 object storage | Any | Sync Streams or Sync Rules | Enabled per instance by PowerSync on request | [Set up S3 object storage](#self-hosted-s3-setup) |

Incremental reprocessing for Postgres and other source databases is planned. See the [proposal](https://github.com/orgs/powersync-ja/discussions/349) for background. It is not supported for legacy [Sync Rules](/sync/rules/overview). If you still use Sync Rules, [migrate to Sync Streams](/sync/streams/migration).
Incremental reprocessing for Postgres and other source databases is planned. See the [proposal](https://github.com/orgs/powersync-ja/discussions/349) for background. It is not supported for legacy [Sync Rules](/sync/rules/overview). If you still use Sync Rules, [migrate to Sync Streams](/sync/rules/migrate-to-sync-streams).

## Opt In

Expand Down
2 changes: 1 addition & 1 deletion sync/grammar/sync-streams/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Grammar Reference (Sync Streams)"
title: "Grammar Reference"
description: "Railroad diagram reference for the SQL grammar supported in Sync Streams queries."
---

Expand Down
Loading
Loading