Skip to content
Merged
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
Binary file added images/installation/supabase-connect-database.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/integration-3.png
Binary file not shown.
Binary file removed images/self-hosting-3.avif
Binary file not shown.
45 changes: 24 additions & 21 deletions self-hosting/appendix/database-connection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,30 @@ Below, you can find provider-specific instructions to obtain connection details

<AccordionGroup>
<Accordion title="Supabase">
1. In your Supabase dashboard, navigate to **"Project Settings"** \-> **"Database" -> "Connection string**" and select the "URI" tab.
2. Uncheck the "**Display connection pooler**" checkbox. PowerSync needs to connect to the database directly and cannot use the pooler.
<Frame>
<img src="/images/self-hosting-3.avif"/>
</Frame>
3. Copy the connection string. The hostname should be `db.<PROJECT-ID>.supabase.co`, and not, for example, `aws-0-us-west-1.pooler.supabase.com`.
4. Paste this URI into the `uri` field under `replication` \> `connections` in your configuration file, for example:

```yaml
# config.yaml

replication:
connections:
- type: postgresql
uri: postgresql://postgres:[YOUR-PASSWORD]@db.abc.supabase.co:5432/postgres
```

5. Replace `[YOUR-PASSWORD]` with the password for the `postgres` user in your Supabase database.
* Supabase also [refers to this password](https://supabase.com/docs/guides/database/managing-passwords) as the _database password_ or _project password_.
6. PowerSync has the Supabase CA certificate pre-configured — `verify-full` SSL mode can be used directly, without any custom certificates.
7. Under `client_auth` enable Supabase Authentication:
1. In your Supabase Dashboard, click **Connect** in the top bar:
<Frame>
<img src="/images/installation/supabase-connect-database.png" />
</Frame>

- Under **Direct connection**, copy the connection string. The hostname should be `db.<PROJECT-ID>.supabase.co`, and not, for example, `aws-0-us-west-1.pooler.supabase.com`.

<Frame>
<img src="/images/installation/supabase-connection-string.png" />
</Frame>

- Paste this URI into the `uri` field under `replication` \> `connections` in your configuration file, for example:
```yaml
# config.yaml

replication:
connections:
- type: postgresql
uri: postgresql://postgres:[YOUR-PASSWORD]@db.abc.supabase.co:5432/postgres
```
2. Replace `[YOUR-PASSWORD]` with the password for the `postgres` user in your Supabase database.
- Supabase also [refers to this password](https://supabase.com/docs/guides/database/managing-passwords) as the *database password* or *project password*.
3. PowerSync has the Supabase CA certificate pre-configured — `verify-full` SSL mode can be used directly, without any custom certificates.
4. Under `client_auth` enable Supabase Authentication:

```yaml
client_auth:
Expand Down
16 changes: 8 additions & 8 deletions snippets/supabase-database-connection.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
1. Copy the database connection details from Supabase:
1. In your Supabase Dashboard, click **Connect** in the top bar:

<Frame caption="It is important to uncheck this checkbox">
<img src="/images/integration-3.png" />
<Frame>
<img src="/images/installation/supabase-connect-database.png" />
</Frame>

* Copy the connection string. The hostname should be `db.<PROJECT-ID>.supabase.co`, and not, for example, `aws-0-us-west-1.pooler.supabase.com`.
* Under **Direct connection**, copy the connection string. The hostname should be `db.<PROJECT-ID>.supabase.co`, and not, for example, `aws-0-us-west-1.pooler.supabase.com`.

<Frame>
<img src="/images/installation/supabase-connection-string.png" />
</Frame>

* Paste this URI in PowerSync instance **URI** field.

Expand All @@ -14,10 +18,6 @@

* PowerSync has the Supabase CA certificate pre-configured — `verify-full` SSL mode can be used directly, without any custom certificates.

* In your Supabase dashboard, navigate to **Project Settings** > **Database** > **Connection string** and select the "URI" tab.

* Uncheck the **Display connection pooler** checkbox. PowerSync needs to connect to the database directly and cannot use the pooler.

2. Click **Test Connection** and fix any errors.

3. Under the **Client Auth** tab, enable **Use Supabase Auth** and enter your Supabase **JWT Secret**:
Expand Down
Loading