Projects
Databases
Browse and edit your projects’ Postgres databases in a table editor, run SQL, and let your agents read them, read-only.
Codz finds the Postgres databases your projects use and opens any of them in a table editor: browse a table’s rows, filter and sort them, edit a cell, insert or delete rows, and run SQL. It works with any Postgres database, including PlanetScale, Supabase, Neon, Amazon RDS and one running on your Mac. Your agents can read the same databases while they work, and they can’t change them.
Open a database
- Choose Databases from the account menu under your name, or Navigate ▸ Databases, or type “Databases” in the command palette (⌘K). The page lists every project’s databases, grouped by project.
- In a chat, open the side panel’s + and choose Database, or choose Workspace ▸ Database. The panel shows the chat’s project’s database; if the project has more than one, a picker at the start of the toolbar switches between them.
The page and the panel share one connection per database, so a table you open on the page is open in the panel too.
Where databases come from
When you open the page or the panel, Codz reads each project’s .env, .env.local, .env.development, .env.development.local, .env.production and .env.production.local, in the project folder and one level into apps/* and packages/*. It lists every Postgres URL it finds under a key like DATABASE_URL, and the local database of a Supabase project (supabase/config.toml). A pooled URL and a direct one for the same database, such as DATABASE_URL and DIRECT_URL, become one entry that connects directly. A database named in more than one of these files is listed once.
Codz doesn’t copy what it finds. It reads the URL from the file each time it connects, so a password you rotate in .env just works. If you point a key at another database, Codz reconnects to that one the next time you open the page or the panel.
To add a database no .env names, click Add database on the page, or in an empty Database panel. Paste its postgres:// URL and choose which project it belongs to. A database in a project shows in that project’s chats and its agents can read it; one in No project shows only on the Databases page. A pasted URL is kept in your Keychain.
Encryption
Codz honours sslmode and sslrootcert as Postgres’s own tools read them:
sslmode | What Codz does |
|---|---|
disable | Never encrypts |
allow, prefer | Encrypts if the server offers it |
require | Always encrypts, without checking the certificate |
verify-ca | Encrypts and checks the certificate against sslrootcert, or your Mac’s trusted roots |
verify-full | Also checks the certificate is for the host you connect to |
sslrootcert=system checks against your Mac’s trusted roots. Supabase and Amazon RDS sign with their own certificate authority: download it and point sslrootcert at the file.
Browse a table
Pick a table in the list on the left, or in the toolbar’s picker in the side panel. Each table opens in a tab. The grid pages 100 rows at a time; the footer changes the page size, moves between pages and switches to the table’s Definition, its SQL.
- Search rows matches text in the table’s text, ID, enum and address columns.
- Filter and Sort combine as many conditions as you like. Click a column’s header for its sort and copy menu.
- Right-click a cell to copy it, copy its row as JSON, filter by its value or follow a foreign key to the row it points at.
- Double-click a long value, or a JSON one, to read it whole in the side pane.
- … exports the page as CSV or JSON.
Long values are cut in the grid and read whole when you open them.
Edit rows
A table you can edit has a primary key; Codz finds each row by it. A table without one, and every view, is read-only, as in Supabase.
- Double-click a cell, or press ↩, to edit it. A boolean or enum offers its values; JSON and long text open in the side pane; anything else is edited in place. ↩ saves, Tab saves and moves right, Esc cancels.
- Right-click a cell for Set to NULL, Set to default and Edit row….
- Insert row adds one. A column you leave on Default takes the database’s default.
- Tick rows and click Delete to delete them. Codz always asks first and shows the statement it will run.
Each value is checked by the database as the column’s type, so a value that doesn’t fit is refused rather than cut or changed.
An edit never overwrites someone else’s. Codz changes a row only while it still holds what you saw. If another app, or a person, changed it in the meantime, Codz says so and changes nothing; refresh to see it as it is now.
⌘Z undoes your edits while the editor stays open, deletes included, again only while the rows still hold what your edit left. A delete can’t be undone when one of its values is too long to keep whole, or when deleting the row also deletes or changes rows in other tables; the confirmation says so.
Production and read-only
Edit in the page’s header marks a database:
- Production puts PRODUCTION beside its name, and a deletion’s confirmation says so. SQL that runs
DELETE,UPDATE,MERGE,TRUNCATE,DROPorALTER, replaces a definition (CREATE OR REPLACE), runs code you can’t see from the text (DO,CALL,EXECUTE) or calls a function such assetval()asks before it runs, with the SQL shown. Codz marks a database production when.env.productionor.env.production.localnames it. - Read-only runs every query in a read-only transaction and turns editing off, the SQL editor included.
- Agents decides whether the project’s agents can read it with Codz’s database tools. It’s on for every database, production ones included; switched off, NO AGENTS shows beside its name and agents can’t see it.
Run SQL
Click + in the tab bar, choose New SQL query from …, or right-click a table and choose Query in SQL editor. ⌘↩ runs the selection, or everything. Every statement runs; the last result shows first, with a picker for the others. If a statement fails, the results before it stay and the editor selects where the server pointed.
A transaction your SQL leaves open is said in the status line, with Roll back. On a read-only database each run is one read-only transaction that Codz rolls back, and a statement that would end it early, such as COMMIT, is refused.
Agents
Agents in a project’s chats can read its databases with Codz’s database tools: list them, describe their tables, and run a query. It works with Claude, ChatGPT, Cursor, OpenCode and the other agents that take tools.
- An agent never sees a connection string or a password.
- A chat reads only its own project’s databases, and none you’ve switched Agents off for.
- A query is one statement that reads:
SELECT,WITH,VALUES,TABLE,SHOWorEXPLAIN. It runs in a read-only transaction that is always rolled back, stops after 15 seconds and returns at most 1,000 rows. - A query can’t call a function whose effect outlasts that rollback, such as one that ends another connection, makes or drops a replication slot, takes a session lock or resets statistics, nor one that runs SQL given as text.
- When Codz connects as a superuser, as it usually does to a database on your Mac, an agent’s query runs as Postgres’s
pg_read_all_datarole, which reads every table and can’t reach the server’s files or programs. That needs Postgres 14 or later.
Read-only isn’t a sandbox: your database’s own functions still do whatever its role may. For a database that must be safe from that, connect Codz with a role that can only read.
Query results go to the agent’s model provider, as everything else an agent reads does. To keep agents out of one database, switch off Agents in its Edit; to turn the tools off everywhere, open Settings ▸ Browser & tools and switch off Databases.
Questions
My database isn’t listed. Codz looks only in the files listed under Where databases come from, for URLs that start with postgres:// or postgresql://. Add it with Add database. MySQL and other databases aren’t supported yet.
It won’t connect. The page says why. “The server’s certificate didn’t check out” usually means verify-full without the provider’s certificate authority: set sslrootcert to its file, or use sslmode=require. Behind a connection pooler, use the direct URL where you have one. Supabase’s dashboard copies its URL with [YOUR-PASSWORD] or [YOUR-DATABASE-PASSWORD] where the password goes: put the password there before you paste it. Supabase’s direct connection works only over IPv6. On a network without IPv6, Codz connects through the pooler URL the same .env names, if it names one; otherwise add the Session pooler URL.
Why is a table read-only? It has no primary key, it’s a view, or the database is marked Read-only.
Are my edits saved right away? Yes. Each edit is its own statement and is committed when it runs. SQL you run in the editor is committed as Postgres’s own tools would, unless it opens a transaction.