The SQL workbench
The workbench is a database client inside the project. Open a PostgreSQL or MySQL connection and you get its tables in a tree, query tabs with completion from the real schema, a grid where you edit rows and apply them as one reviewed batch, and a history that can undo what it ran.
- Open the workbench and run a query in a tab
- Browse a table, filter it and edit rows with a reviewed apply
- Read the warnings a query gets and why
- Find and revert past operations in the history
How the workbench is laid out
On Integrations, a database card’s Open takes you to its workbench. The left side is the schema tree — Tables open by default, Views, Functions and Procedures folded — with a search box and Refresh schema. The middle holds tabs, and a history drawer opens on the right.
1SELECT *2FROM customers3LIMIT 100;| Tab | Opened by | What it shows |
|---|---|---|
| Query | + → New query | A SQL editor and the result grid under it |
| Table / view | Clicking a table or view in the tree, or picking it in the + menu | Its rows with filter, columns, sort and editing |
| Routine | Clicking a function or procedure | Its definition, a parameters grid and a run button |
The + menu also searches every table, view, function and procedure by name, so a large schema is one keystroke away. The workbench opens the first table by itself the first time you visit.
Run a query
- Open a query tab
Click + and New query. The editor completes table and column names from the schema it loaded.
- Write and run
Press Run or Ctrl+Enter (⌘+Enter on a Mac). The grid shows the rows, the row count and the time the database took.
- Read the warnings
Above the grid, yellow lines say what could make the query costly. They never stop it from running.
SELECT c.name, COUNT(o.id) AS orders, SUM(o.total) AS revenue
FROM customers c
JOIN orders o ON o.customer_id = c.id
WHERE o.created_at >= now() - interval '30 days'
GROUP BY c.name
ORDER BY revenue DESC
LIMIT 20;Browse and edit a table
A table tab reads the table with a Filter (column, operator, value), a Show picker for the columns you want, sorting by clicking a header, and a Limit of 50, 100, 200 or 500 rows — 100 by default. Show SQL reveals the exact SELECT it sends.
Edits wait until you apply them
- Change what you need
Double-click a cell to edit it, use Add row (the form marks required fields and lets an auto-increment key be generated), or select rows and delete them. Nothing is written yet: each change is highlighted, and a bar says Editing · 3 changes.
- Review the SQL
Click Apply. A confirmation shows SQL to be executed — every
INSERT,UPDATEandDELETEbuilt from your edits. - Apply or cancel
Apply changes runs the batch and reloads the tab; Cancel on the bar throws every pending edit away.
The tree’s right-click menu creates and changes structure: Edit table opens the table designer (columns, types, primary key, required, default, foreign keys, indexes) with the Generated SQL shown before you apply; Truncate data and Delete table ask first.
Warnings and row limits
Every query is read before it runs and timed after. The answer carries a list of warnings — empty when the query is clean — and the workbench always shows them:
| The query… | Warning |
|---|---|
has no LIMIT | Query has no LIMIT clause — this may return a very large result set |
| asks for more than 500 rows | Query LIMIT 1000 exceeds the maximum of 500 rows |
uses CROSS JOIN | Query contains CROSS JOIN which may produce a very large result set |
has three or more JOINs | Query contains 3 JOINs — consider whether all are necessary |
| took more than 3 s / 8 s | Query took 4210ms (>3s) / (>8s) |
The cap only wraps plain reads (SELECT and WITH). Statements that write — INSERT, UPDATE, DELETE, CREATE, ALTER, DROP — run as written.
History and revert
The Query history button opens every operation run against this connection, newest first, with its status (Succeeded, Failed, Reverted), its time and What was executed. The history is kept on the server per connection — the last 200 entries — so a teammate opening the same workbench sees it too.
- Row edits, inserts, deletes, truncates and dropped tables record the SQL that undoes them. Such an entry is marked Revertible.
- Reverting shows Revert SQL to be executed first; confirming runs it and adds a new entry marked with ↩, linked to the original.
- A revert restores data, not time: rows another process changed in between are not merged.
Limits and access
- PostgreSQL and MySQL only. S3 connections open the file browser instead.
- Running queries needs Edit access to Integrations in the project; see Team access.
- MySQL hides a routine’s body from anyone but its DEFINER. Grant
ALTER ROUTINEto the connection’s user to read definitions.