Skip to content
16 changes: 13 additions & 3 deletions client-sdks/advanced/checkpoint-requests.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,21 @@ Before creating a checkpoint request:

<CodeGroup>
```typescript JavaScript/TypeScript
// Requires @powersync/web 2.3.0, @powersync/react-native 2.2.0,
// @powersync/node 1.0.0, or @powersync/capacitor 0.9.0 or later
await db.connect(connector, { checkpointMode: 'requests' });
```

```dart Dart
// Requires powersync 2.4.0 or later
await db.connect(
connector: connector,
options: SyncOptions(checkpointMode: .requests()),
);
```

```kotlin Kotlin
// Requires PowerSync Kotlin SDK 1.15.0 or later
database.connect(
connector,
options = SyncOptions(
Expand All @@ -62,16 +66,18 @@ database.connect(
```

```swift Swift
// Requires PowerSync Swift SDK 1.16.0 or later
try await database.connect(
connector: connector,
options: ConnectOptions(checkpointMode: .requests())
)
```

```cs .NET
// Requires PowerSync.Common 0.1.5 or later
await database.Connect(
connector: connector,
options: new PowerSyncConnectOptions(checkpointMode: new CheckpointMode.Requests())
options: new PowerSyncConnectionOptions(checkpointMode: new CheckpointMode.Requests())
);
```
</CodeGroup>
Expand Down Expand Up @@ -284,9 +290,13 @@ The upload response remains the authority on whether your backend accepted, chan

## Asynchronous Upload Backends

The managed flow assumes that `uploadData()` returns only after your backend commits the uploaded changes to the source database. If your backend queues uploads for later processing, use custom checkpoint requests. This feature is available for customers on [Team and Enterprise](https://www.powersync.com/pricing) plans.
<Note>
This feature is available for customers on [Team and Enterprise](https://www.powersync.com/pricing) plans.
</Note>

The managed flow assumes that `uploadData()` returns only after your backend commits the uploaded changes to the source database. If your backend queues uploads for later processing, use custom checkpoint requests.

Follow the [Custom Write Checkpoints source-side setup](/handling-writes/custom-write-checkpoints#sync-rules-requirements), including its `checkpoint_requests` event definition. The `checkpoint` column stores the checkpoint request ID generated by the client.
Follow [Setting Up Custom Checkpoint Requests](/handling-writes/custom-write-checkpoints#setting-up-custom-checkpoint-requests) for the source database, Sync Config, and backend changes. If older app versions still use legacy Custom Write Checkpoints, see [Migrating to Custom Checkpoint Requests](/handling-writes/custom-write-checkpoints#migrating-to-custom-checkpoint-requests).

The difference on the client is that the PowerSync Client SDK generates the checkpoint request ID and sends it to your backend through `CustomCheckpointRequestConnector`.

Expand Down
4 changes: 4 additions & 0 deletions configuration/powersync-service/self-hosted-instances.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# Note only 1 connection is currently supported
# Multiple connection support is on the roadmap
connections:
- type: postgresql

Check warning on line 27 in configuration/powersync-service/self-hosted-instances.mdx

View check run for this annotation

Mintlify / Mintlify Validation (powersync) - vale-spellcheck

configuration/powersync-service/self-hosted-instances.mdx#L27

Use 'Postgres' instead of 'postgresql'.
# The PowerSync server container can access the Postgres DB via the DB's service name.
# In this case the hostname is pg-db

Expand Down Expand Up @@ -467,6 +467,10 @@

<ResponseField name="default_storage_version" type="number" default="2">
Storage version to use when deploying a Sync Config that does not specify a storage version. To opt in to [storage version 4](/sync/advanced/storage-version-4) (Beta), set `config.storage_version: 4` in your Sync Config. An explicit `config.storage_version` takes precedence over this default. Available since Service version 1.26.0.

<Note>
Postgres bucket storage does not currently support version 4.
</Note>
</ResponseField>

#### MongoDB Storage
Expand Down
Loading
Loading