Every tool that reads your database's structure asks for a connection string, and most people paste in the one they already have. That login can usually read every row and often change them. A tool that only needs table definitions shouldn't hold it.
Make a login that sees the catalog and nothing else
In the editor, open Import → Live database (on Pro and above). The wizard asks for the Engine and where it's Hosted on, then moves to the connection step. Under the Connection string field there's a folded section called "Make a read-only user for this".
Open it and you get two fields: User name (it starts as data_modeller_reader) and the schemas it reads (for MySQL and MariaDB these are databases). The second field is the same list the import reads, so changing it in one place changes it in both. Below them is the SQL for your engine and host, written with a generated password, and a Copy button.
You run that SQL yourself, as an admin, in whatever client you normally use. The app never runs it for you, and none of the scripts opens a transaction you'd have to finish. Then connect as the new user with the password from the script.
A few details that are easy to miss:
- The password is 24 characters drawn from letters, digits,
-and_, so it never needs escaping in a connection string. A new one is made each time you open the import. - User and schema names must be letters, digits and underscores, starting with a letter, up to 63 characters. Anything else and the script isn't written; you get "Use letters, digits and underscores, starting with a letter." instead. That keeps names unquoted and the same on every engine.
- Leave the schemas empty and the script uses the guide's example (
public,dbo,apporAPP). Change it before you run it.
What each engine's script looks like
Here is what the guides write for a user called data_modeller_reader. The password shown is an example; yours is generated.
PostgreSQL
Reading public and billing:
create role data_modeller_reader login password 'k7Rz_Q2mNpX9aLw4TbE8cYh3';
alter role data_modeller_reader set default_transaction_read_only = on;
grant references on all tables in schema "public" to data_modeller_reader;
-- Tables you create later, as the role running this.
alter default privileges in schema "public" grant references on tables to data_modeller_reader;
grant references on all tables in schema "billing" to data_modeller_reader;
-- Tables you create later, as the role running this.
alter default privileges in schema "billing" grant references on tables to data_modeller_reader;
REFERENCES is the privilege to point a foreign key at a table. It makes the table's columns and keys visible in the catalog without letting the login read a row, and since the login can't create a table of its own, it can't use the privilege for anything. The role also starts every session read-only. The default-privileges line only covers tables created later by the role that runs the script, as the comment says. Tables someone else creates need the grant again.
Amazon RDS, Aurora, Cloud SQL, Azure Database for PostgreSQL and Neon get the same script. Supabase does too, with a note to run it in the SQL editor, and that through the session pooler the user name gets your project ref after a dot.
MySQL and MariaDB
Reading the shop database:
CREATE USER 'data_modeller_reader'@'%' IDENTIFIED BY 'k7Rz_Q2mNpX9aLw4TbE8cYh3';
GRANT REFERENCES, SHOW VIEW ON `shop`.* TO 'data_modeller_reader'@'%';
information_schema shows a login the objects it holds any privilege on, so REFERENCES makes the tables visible and SHOW VIEW adds the views' definitions. Neither reads a row.
SQL Server and Azure SQL Database
SQL Server has a privilege made for this, VIEW DEFINITION:
-- In master:
CREATE LOGIN data_modeller_reader WITH PASSWORD = 'k7Rz_Q2mNpX9aLw4TbE8cYh3';
-- Then in the database you import:
CREATE USER data_modeller_reader FOR LOGIN data_modeller_reader;
GRANT VIEW DEFINITION ON SCHEMA::[dbo] TO data_modeller_reader;
Azure SQL Database gets a user contained in the database instead, with no login in master:
CREATE USER data_modeller_reader WITH PASSWORD = 'k7Rz_Q2mNpX9aLw4TbE8cYh3';
GRANT VIEW DEFINITION ON SCHEMA::[dbo] TO data_modeller_reader;
Oracle
Oracle's ALL_ views show what the user holds a privilege on, so the script grants REFERENCES table by table. Owner names are upper-cased for you:
CREATE USER data_modeller_reader IDENTIFIED BY "k7Rz_Q2mNpX9aLw4TbE8cYh3";
GRANT CREATE SESSION TO data_modeller_reader;
-- Tables added later need the same grant.
BEGIN
FOR t IN (SELECT owner, table_name FROM all_tables WHERE owner IN ('APP')) LOOP
EXECUTE IMMEDIATE 'GRANT REFERENCES ON "' || t.owner || '"."' || t.table_name || '" TO data_modeller_reader';
END LOOP;
END;
/
Views stay hidden from this login. Seeing one needs READ, which reads its rows, so the guide leaves them out rather than widen the login.
CockroachDB
CockroachDB lists a table only to someone with a privilege on it, and it has no REFERENCES. So this is the one script where the login can read rows, and the note under it says so. It still can't change anything:
create user data_modeller_reader with login password 'k7Rz_Q2mNpX9aLw4TbE8cYh3';
grant usage on schema "public" to data_modeller_reader;
grant select on all tables in schema "public" to data_modeller_reader;
Hosts that issue tokens instead
PlanetScale, Turso and Cloudflare D1 don't take CREATE USER, so the section is called "Make a read-only token for this" and gives steps instead of SQL. On PlanetScale, create a branch password with the Reader role (Branch → Connect → New password). On Turso, run turso db tokens create <database> --read-only. For D1, create a custom API token with one permission, Account → D1 → Read, for that account only. Each of these can read rows but can't change anything, and the steps say so.
Or let a host API key make the login
For Neon, PlanetScale and Turso there's a quicker way. On the connection step, switch "Connect with" from the connection string to the host's API key, press "Find databases", pick one and press "Create a read-only login".
- Neon: the app signs in once as the database's owner and runs the same PostgreSQL script as above, for every schema the database holds, inside one transaction, so a failed grant leaves no half-made role. The role is named
data_modeller_reader_plus a random suffix. Projects that don't store role passwords can't do this; you'll be told to use the guide instead. - PlanetScale: creates a branch password with the Reader role.
- Turso: creates a read-only token for the database. It doesn't expire, so revoke it on Turso when you're done.
The key is used for those calls and then dropped; it's never stored. The new login fills in the form, and the app tells you what it made so you can remove it on the host later.
Cloudflare D1 is different. Cloudflare can't make anything narrower than a D1 Read token, so the token you paste is the connection, and it's kept only if you keep the connection.
What happens to the connection
- The host is resolved before anything connects, and the driver connects to that checked address, not the name again. Private, loopback, link-local (including cloud metadata addresses), carrier-grade NAT and reserved ranges are refused, for IPv4 and IPv6. Every socket a database driver opens during the read is checked again, so Oracle listener redirects can't send it somewhere internal either.
- Errors come back as a plain category, such as "The database rejected the username or password." or "That database doesn't exist on the server.", rather than the driver's raw message.
- Each person gets 20 reads every ten minutes. Past that, the import says "Too many database imports. Try again in a few minutes."
- A read takes at most 20 schemas.
- Nothing is kept unless you tick "Keep as the linked database, to pull again and hear when it changes" on the last step, and then it's encrypted.
When the login isn't enough
A catalog-only login limits what a leaked connection string can do. It doesn't stop the connection passing through our servers during a read. If that's more trust than you want, keep the connection sealed in your workspace vault, which we can't open, or read through the local agent on your own machine, so the database never has to be reachable from the internet.