Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions client-sdks/advanced/pre-seeded-sqlite.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If you're interested in seeing an end-to-end example, we've prepared a demo repo

# Main Concepts

## Generate a scoped JWT token
## Generate a Scoped JWT Token
In most cases you'd want to pre-seed the SQLite database with user specific data and not all data from the source database, as you normally would when using PowerSync. For this you would need to generate JWT tokens that include the necessary properties to satisfy the conditions of the queries in your Sync Streams (or legacy Sync Rules).

Let's say we have the following sync config:
Expand Down Expand Up @@ -71,7 +71,7 @@ export const generateToken = async (subject: string, store_id: string) => {
};
```

## Pre-seeding script
## Pre-seeding Script

Once you've got a plan in place for generating the JWT tokens, you can write a simple script to connect to the PowerSync instance and pre-seed the SQLite database. Here's an example of a script that does this:

Expand Down
4 changes: 2 additions & 2 deletions client-sdks/frameworks/flutter-web-support.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Since version 1.9.0, web support for Flutter is in a **beta** release. It is fun
Please see the [Limitations](#limitations) detailed below.
</Note>

## Demo app
## Demo App

The easiest way to test Flutter Web support is to run the [Supabase Todo-List](https://github.com/powersync-ja/powersync.dart/tree/main/demos/supabase-todolist) demo app:

Expand All @@ -21,7 +21,7 @@ The easiest way to test Flutter Web support is to run the [Supabase Todo-List](h
4. If you haven’t yet: `cp lib/app_config_template.dart lib/app_config.dart` (optionally update this config with your own Supabase and PowerSync project details).
5. Run `flutter run -d chrome`

## Installing PowerSync in your own project
## Installing PowerSync in Your Own Project

Install the [latest version](https://pub.dev/packages/powersync/versions) of the package, for example:

Expand Down
2 changes: 1 addition & 1 deletion client-sdks/frameworks/next-js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@

To set up a new PowerSync instance, follow the steps covered in the [Installation - Database Connection](/configuration/source-db/connection) docs page.

## Configure PowerSync in your project
## Configure PowerSync in Your Project
### Add core PowerSync files
Start by adding a new directory in `./src/lib` named `powersync`.

Expand Down Expand Up @@ -323,7 +323,7 @@

#### Update `layout.tsx`

Update `RootLayout` to wrap `children` with the `PowerSyncProvider`. Importantly, **the root layout should remain a Server Component** — do not add `'use client'` here. This is the standard Next.js App Router convention and is required if you want to export `metadata` (or use `generateMetadata`) from the layout. The client boundary is drawn at `PowerSyncProvider`, which is all that's needed to get PowerSync running in the browser.

Check warning on line 326 in client-sdks/frameworks/next-js.mdx

View check run for this annotation

Mintlify / Mintlify Validation (powersync) - vale-spellcheck

client-sdks/frameworks/next-js.mdx#L326

Did you really mean 'generateMetadata'?

```typescript app/layout.tsx
import type { Metadata } from 'next';
Expand Down
2 changes: 1 addition & 1 deletion client-sdks/frameworks/nuxt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default defineNuxtConfig({
If you are using Tailwind CSS in your project, see the [Known Issues](#known-issues) section.
</Warning>

## Configure PowerSync in your Project
## Configure PowerSync in Your Project

### Define your Schema

Expand Down
2 changes: 1 addition & 1 deletion client-sdks/frameworks/react-native-web-support.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ A demo app showcasing this functionality is available here:

<Card title="powersync-js/demos/react-native-web-supabase-todolist" icon="github" href="https://github.com/powersync-ja/powersync-js/tree/main/demos/react-native-web-supabase-todolist" horizontal />

## Configuring PowerSync in your React Native for Web project
## Configuring PowerSync in Your React Native for Web Project

To ensure that PowerSync features are fully supported in your React Native Web project, follow the below steps. This documentation covers necessary web worker configurations, database instantiation, and multi-platform implementations.

Expand Down
2 changes: 1 addition & 1 deletion client-sdks/orms/js/drizzle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export const AppSchema = new Schema({
});
```

## Compilable queries
## Compilable Queries

To use Drizzle queries in your hooks and composables, they currently need to be converted using `toCompilableQuery`.

Expand Down
4 changes: 2 additions & 2 deletions client-sdks/orms/kotlin/room.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ To add PowerSync to your Room database,
Room.databaseBuilder(...).setDriver(driver).build()
```

## Encrypted databases
## Encrypted Databases

When using PowerSync with Room, PowerSync wraps the Room database instead of opening its own connection. To use an encrypted database with Room, implement `SQLiteDriver` by delegating to `PersistentConnectionFactory` and pass that to `RoomDatabase.Builder.setDriver`:

Expand Down Expand Up @@ -178,7 +178,7 @@ todoItemsDao.watchAll().collect { items ->
}
```

## Local writes
## Local Writes

To transfer local writes from Room to PowerSync:

Expand Down
2 changes: 1 addition & 1 deletion client-sdks/reference/tauri.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ const deleteList = async (id) => {

The Rust SDK uses the `log` crate which can be enabled using the [Tauri logging plugin](https://v2.tauri.app/plugin/logging/).

## Sharing a database with Rust code
## Sharing a Database with Rust Code

A `PowerSyncTauriDatabase` instance can be shared with Rust code:

Expand Down
2 changes: 1 addition & 1 deletion debugging/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "Troubleshooting"
description: "Diagnose and fix common PowerSync issues using logs, diagnostics, and troubleshooting tools."
---

## Common issues
## Common Issues

<Tip>
**Tip**: Asking the AI bot on this page, or on the [#gpt-help](https://discord.com/channels/1138230179878154300/1304118313093173329) channel on our [Discord server](https://discord.com/invite/powersync), is a good way to troubleshoot common issues.
Expand Down
6 changes: 3 additions & 3 deletions integrations/flutterflow/attachments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The schema of the local SQLite database should now be updated to include the new
<img src="/images/integration-guides/flutterflow/app-constant-storage-bucket.png" />
</Frame>

## Add the PowerSync Attachments Helper to your project
## Add the PowerSync Attachments Helper to Your Project

1. Under **"App Settings" -> "Project Dependencies" -> "Custom Pub Dependencies"** click "Add Pub Dependency".
2. Enter `powersync_attachments_helper: ^0.6.18`.
Expand Down Expand Up @@ -322,7 +322,7 @@ This action handles uploads by passing the `UploadedFile` to local storage and t
If, at this stage, you receive errors for any of the custom actions, test your app and ensure there are no errors in your Device Logs. FlutterFlow does occasionally show false compilation errors which can safely be ignored.
</Warning>

## Create a Custom Component to display and upload photos
## Create a Custom Component to Display and Upload Photos

Next, we'll create a custom component that displays an image and includes a button to upload or replace the image file. You can use this component throughout your app wherever you need to display and update images.

Expand Down Expand Up @@ -483,7 +483,7 @@ Next, we'll create a custom component that displays an image and includes a butt
11. Set the Value to "Component Parameters" -> `listId`.
12. Click "Confirm".

## Add the `ListImage` Custom Component to your page
## Add the `ListImage` Custom Component to Your Page

1. Under the **"Page Selector"**, select the `Todos` page.
2. Under the **"Widget Tree"**, right-click on the `PowerSyncStateUpdater` library component.
Expand Down
8 changes: 4 additions & 4 deletions integrations/serverpod.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

Of course, all steps and migrations also apply to established projects.

## Database setup
## Database Setup

Begin by configuring your Postgres database for PowerSync. PowerSync requires logical replication
to be enabled. With the `docker-compose.yaml` file generated by Serverpod, add a `command` to the `postgres`
Expand Down Expand Up @@ -136,7 +136,7 @@
After adding these statements to `migration.sql`, also add them to `definition.sql`. The reason is that Serverpod
runs that file when instantiating the database from scratch, `migration.sql` would be ignored in that case.

## PowerSync configuration
## PowerSync Configuration

PowerSync requires a service to process Postgres writes into a form that can be synced to clients.
Additionally, your Serverpod backend will be responsible for generating JWTs to authenticate clients as
Expand Down Expand Up @@ -255,7 +255,7 @@
kid: !env PS_JWK_KID
```

<Tip>More information on available options is available under [Service Configuration](/configuration/powersync-service/self-hosted-instances)</Tip>

Check warning on line 258 in integrations/serverpod.mdx

View check run for this annotation

Mintlify / Mintlify Validation (powersync) - vale-spellcheck

integrations/serverpod.mdx#L258

Did you really mean 'infor'?

## Authentication

Expand Down Expand Up @@ -357,7 +357,7 @@
Also remove invocations related to future calls in `lib/server.dart`.
Don't forget to run `serverpod generate` afterwards.

## Data sync
## Data Sync

With all services, configured, it's time to spin up development services:

Expand All @@ -383,7 +383,7 @@
```

With your Serverpod backend and PowerSync running, you can start connecting your clients.
Go to the `_flutter` project generated by Serverpod and run `dart pub add powersync path path_provider`.

Check warning on line 386 in integrations/serverpod.mdx

View check run for this annotation

Mintlify / Mintlify Validation (powersync) - vale-spellcheck

integrations/serverpod.mdx#L386

'path' is repeated!
Next, replace `main.dart` with this demo:

```dart
Expand Down Expand Up @@ -543,7 +543,7 @@
} else if (snapshot.hasError) {
return Text(snapshot.error.toString());
} else {
return const CircularProgressIndicator();

Check warning on line 546 in integrations/serverpod.mdx

View check run for this annotation

Mintlify / Mintlify Validation (powersync) - vale-spellcheck

integrations/serverpod.mdx#L546

Did you really mean 'ato'?
}
},
),
Expand Down Expand Up @@ -611,7 +611,7 @@
3. Add new items to the database and stop your backend to simulate being offline. Deleting items still updates the client
immediately, changes will be written to Postgres as your backend comes back online.

## Next steps
## Next Steps

This guide demonstrated a minimal setup with PowerSync and Serverpod. To expand on this, you could explore:

Expand Down
6 changes: 3 additions & 3 deletions maintenance-ops/client-database-diagnostics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "Understanding the SQLite Database"
description: "Analyze and debug the local PowerSync SQLite database on the client."
---

## Get the SQLite file
## Get the SQLite File

<Note>
A SQLite database file can use any extension - .db, .sqlite, .sqlite3, etc. The extension doesn’t affect functionality; all contain the same SQLite format. To ensure no recent changes are lost, you can either: Pull the associated [Write-Ahead Log (WAL)](https://www.sqlite.org/wal.html) file (with the same name as the database plus the suffix `-wal`). Or alternatively, run the command `PRAGMA wal_checkpoint(TRUNCATE);` on the database before pulling it, which will merge the WAL file's changes into the main database file.
Expand Down Expand Up @@ -84,7 +84,7 @@ downloadDatabase();
</Tab>
</Tabs>

## Inspecting the SQLite file
## Inspecting the SQLite File

### 1. Open your SQLite file

Expand Down Expand Up @@ -159,7 +159,7 @@ SELECT

This shows which tables have rows appearing in more than one bucket, which buckets contain them, and how much space the duplicates consume.

## Reducing SQLite file size
## Reducing SQLite File Size

<Note>
Both methods of reducing the size of the SQLite file can be executed within the client using `powerSync.execute()`.
Expand Down
2 changes: 1 addition & 1 deletion maintenance-ops/compacting-buckets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
2. **Scheduled Defragmentation**
- Set up a cron job to regularly update rows
- Recommended for frequently updated tables or tables with large churn
- Example using pg_cron:

Check warning on line 156 in maintenance-ops/compacting-buckets.mdx

View check run for this annotation

Mintlify / Mintlify Validation (powersync) - vale-spellcheck

maintenance-ops/compacting-buckets.mdx#L156

Did you really mean 'pg_cron'?
```sql
-- Daily defragmentation for high-churn tables
UPDATE audit_logs SET last_updated = now()
Expand All @@ -180,6 +180,6 @@

Soon, we will use [incremental sync rule reprocessing](https://github.com/orgs/powersync-ja/discussions/349) to process changed definitions only.

## Technical details
## Technical Details

See the [documentation](https://github.com/powersync-ja/powersync-service/blob/main/docs/compacting-operations.md) in the `powersync-service` repo for more technical details on compacting.
2 changes: 1 addition & 1 deletion maintenance-ops/production-readiness-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ SELECT COUNT(*) AS row_count FROM ps_crud;

If you're interested in learning more about the internal PowerSync SQLite schema, see the [Client Architecture](/architecture/client-architecture#schema) section of the docs.

## Client logging
## Client Logging

### Using `Sentry logging` for Log Aggregation

Expand Down
4 changes: 2 additions & 2 deletions sync/advanced/compatibility.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ streams:
**Upgrading from alpha**: If you have existing Sync Streams using `edition: 2`, upgrade to `edition: 3` to enable the new compiler with an expanded SQL feature set (including `JOIN`, CTEs, multiple queries per stream, `BETWEEN`, `CASE`, and more). See [Supported SQL](/sync/supported-sql) for the full list of supported features.
</Note>

## Storage version
## Storage Version

The PowerSync Service stores replicated bucket data in [bucket storage](/architecture/powersync-service#bucket-storage). That data uses a storage version that can evolve when you deploy new Sync Streams or Sync Rules. This versioning approach avoids large upfront migrations on existing bucket data when the Service introduces bigger storage changes. Each time your sync config is deployed and processed, the bucket data written for that deployment uses a specific storage version.

Expand Down Expand Up @@ -89,7 +89,7 @@ The service distinguishes stable and experimental storage versions as follows:
- Even numbers (for example `2`, `4`) denote stable formats. Once a stable version is supported, newer Service releases are expected to keep supporting it until it is officially deprecated.
- Odd numbers (for example `3`) denote unstable formats. The layout may change without notice and support may be removed in a future release. Use odd versions only for testing, not production.

## Supported fixes
## Supported Fixes

This table lists all fixes currently supported:

Expand Down