Skip to main content
Midplane only reads, whatever user it connects as. Its own role adds the database’s lock: reads only, few connections, a time limit. The source’s page makes the script, password included, and switches the source to the role.

Run it

You need a user that can create roles (Postgres) or users (MySQL).
  1. On Postgres, untick any schema under Schemas it reads that Midplane shouldn’t read. Read past row-level security comes ticked on Supabase; Midplane’s own access rules still apply.
  2. Select Make the script. It names the role (midplane_ and eight letters and digits) and shows its password this once. Make a new script replaces the one waiting: run only the latest.
  3. Run it once, as an admin, in the source’s own database. For a read replica, run it on the primary.
  4. Select Switch to midplane_…. Midplane logs in as the role, checks it, and replaces the credentials it holds: it no longer keeps the user you first connected with.

What the Postgres script does

One DO block, so it runs whole or not at all. Pasted in part, it is a syntax error; run in another database, it stops with Connect to the database shop first: nothing was changed.

What the MySQL script does

The password is plain in the script; MySQL hides it in its logs. MySQL has no per-account max_execution_time, so Midplane sets it per connection.

The role check

Every test and every switch checks what the user Midplane connects as can do beyond reading. Midplane still only reads; a warning means the database wouldn’t stop it. Each names up to five objects. BYPASSRLS is not a warning. Any warning shows Role can do more than read on Sources.

Postgres 14 and older

Before Postgres 15, every role may create tables in public, so even Midplane’s role gets can create tables in some schemas (public). To clear it, revoke that from everyone, as Postgres 15 does, once you’ve checked nothing of yours creates tables there as another user:

When you cannot run the script

Some hosts let no user create roles: on Fly Managed Postgres the script stops with a permission error and changes nothing. Connect with the host’s own read-only user instead, or paste its string under Credentials and select Test and replace:
  • Fly: a user with the Reader role (Fly).
  • PlanetScale Postgres: a dashboard role with pg_read_all_data (PlanetScale).
Without the script you give up the role’s connection and time limits, and tables made later are readable only if your user’s grants cover them. Midplane still keeps its connections few and limits every statement.