Skip to content

Polish #196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
33 changes: 17 additions & 16 deletions installation/database-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ import PostgresPowerSyncPublication from '/snippets/postgres-powersync-publicati

Configuring your Postgres database for PowerSync generally involves three tasks:

1. Enable logical replication
1. Ensure logical replication is enabled
2. Create a PowerSync database user
3. Create `powersync` logical replication publication

We have documented steps for some hosting providers:

<AccordionGroup>
<Accordion title="Supabase">
### 1. Enable logical replication
### 1. Ensure logical replication is enabled

Supabase has logical replication enabled by default — no action required.
No action required: Supabase has logical replication enabled by default.

### 2. Create a PowerSync database user

Expand All @@ -47,13 +47,14 @@ We have documented steps for some hosting providers:
</Frame>
Access may be restricted to specific IPs if required — see [IP Filtering](/installation/database-setup/security-and-ip-filtering).

### 1. Enable logical replication
### 1. Ensure logical replication is enabled

Set the `rds.logical_replication` parameter to `1` in the parameter group for the instance:

<Frame>
![](/images/setup-2.png)
</Frame>

### 2. Create a PowerSync database user

Create a PowerSync user on Postgres:
Expand Down Expand Up @@ -83,7 +84,7 @@ We have documented steps for some hosting providers:

The database must be accessible on the public internet. Once you have created your database, navigate to **Settings** → **Networking** and enable **Public access.**

### 1. Enable logical replication
### 1. Ensure logical replication is enabled

Follow the steps as noted in [this Microsoft article](https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-logical#prerequisites-for-logical-replication-and-logical-decoding) to allow logical replication.

Expand All @@ -96,7 +97,7 @@ We have documented steps for some hosting providers:
<PostgresPowerSyncPublication />
</Accordion>
<Accordion title="Google Cloud SQL">
### 1. Enable logical replication
### 1. Ensure logical replication is enabled

In Google Cloud SQL Postgres, enabling the logical replication is done using flags:

Expand All @@ -114,14 +115,14 @@ We have documented steps for some hosting providers:
<Accordion title="Neon">
Neon is a serverless Postgres environment with an innovative pricing model that separates storage and compute.

### 1. Enable Logical Replication
### 1. Ensure logical replication is enabled

To [enable logical replication](https://neon.tech/docs/guides/logical-replication-postgres#prepare-your-source-neon-database):
To [Ensure logical replication is enabled](https://neon.tech/docs/guides/logical-replication-postgres#prepare-your-source-neon-database):

1. Select your project in the Neon Console.
2. On the Neon Dashboard, select **Settings**.
3. Select **Logical Replication**.
4. Click **Enable** to enable logical replication.
4. Click **Enable** to Ensure logical replication is enabled.

### 2. Create a PowerSync database user

Expand All @@ -134,9 +135,9 @@ We have documented steps for some hosting providers:
<Accordion title="Fly Postgres">
Fly Postgres is a [Fly](https://fly.io/) app with [flyctl](https://fly.io/docs/flyctl/) sugar on top to help you bootstrap and manage a database cluster for your apps.

### 1. Enable logical replication
### 1. Ensure logical replication is enabled

Once you've deployed your Fly Postgres cluster, you can use the following command to enable logical replication:
Once you've deployed your Fly Postgres cluster, you can use the following command to Ensure logical replication is enabled:

```bash
fly pg config update --wal-level=logical
Expand All @@ -154,9 +155,9 @@ We have documented steps for some hosting providers:
<PostgresPowerSyncPublication />
</Accordion>
<Accordion title="PlanetScale">
### 1. Enable logical replication
### 1. Ensure logical replication is enabled

`wal_level = logical` is required and PlanetScale has this set by default - no action needed.
No action required: PlanetScale has logical replication (`wal_level = logical`) enabled by default.

### 2. Create a PowerSync database user

Expand All @@ -181,7 +182,7 @@ For other providers and self-hosted databases:
<Accordion title="Other / Self-hosted">
Need help? Simply contact us on [Discord](https://discord.gg/powersync) and we'll help you get set up.

### 1. Enable logical replication
### 1. Ensure logical replication is enabled

PowerSync reads the Postgres WAL using logical replication in order to create sync buckets in accordance with the specified PowerSync [Sync Rules](/usage/sync-rules).

Expand All @@ -190,14 +191,14 @@ For other providers and self-hosted databases:
<Frame>
![](/images/setup-6.avif)
</Frame>
Alternatively, you can use the below SQL commands to check and enable logical replication:
Alternatively, you can use the below SQL commands to check and Ensure logical replication is enabled:

```sql
-- Check the replication type

SHOW wal_level;

-- Enable logical replication
-- Ensure logical replication is enabled

ALTER SYSTEM SET wal_level = logical;
```
Expand Down