> ## Documentation Index
> Fetch the complete documentation index at: https://midplane.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Supabase

> Connect Supabase to Midplane: the session pooler or the direct connection, verified TLS with Supabase's own CA, and the role script with row-level security in mind.

**1. Copy a connection string**

Under **Connect** at the top of the project, choose one
([Supabase's guide](https://supabase.com/docs/guides/database/connecting-to-postgres)):

* **Session pooler**: IPv4 on every plan, with the user
  `postgres.<project ref>`.

  ```text theme={null}
  postgres://postgres.abcdefghijklmnop:<password>@aws-0-eu-central-1.pooler.supabase.com:5432/postgres
  ```

* **Direct connection**: `db.<project ref>.supabase.co`, IPv6 unless you
  have the IPv4 add-on. Midplane connects over IPv6 too.

Not the transaction pooler (port 6543).

**2. Let Midplane in, if network restrictions are on**

Add both of your region's [egress addresses](https://midplane.ai/docs/connect/allowlist.md), IPv4
and IPv6, to Supabase's
[network restrictions](https://supabase.com/docs/guides/platform/network-restrictions).

**3. Keep Read past row-level security ticked**

It comes ticked on Supabase: without it, Midplane's role reads no rows
from a table whose policies don't name it. Midplane's own access rules
still apply. Run the script in the **SQL Editor**, which is connected to
`postgres`. On the session pooler, Midplane logs in as
`midplane_….<project ref>` by itself ([the role script](https://midplane.ai/docs/connect/role.md)).

Midplane carries Supabase's root CA: **TLS verified**, no CA to paste.
Before the switch, the role check warns about `postgres` owning the tables
made in Supabase's dashboard.

> [accordion] If agents get empty tables
>
> The role was made without **Read past row-level security**: make a new
> script with it ticked, run it, and switch.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.