Run it
You need a user that can create roles (Postgres) or users (MySQL).- 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.
- 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. - Run it once, as an admin, in the source’s own database. For a read replica, run it on the primary.
- 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
OneDO 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 inpublic, 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).