The database client that shows you the SQL before it runs.
Query Anvil is a desktop app for PostgreSQL, MySQL, MariaDB and SQLite on macOS and Windows. Browse tables, write queries and edit rows. Every change turns into the exact statement it will run, and production connections stay read only.
US$70 once. Every future update included.
Workflow demonstrations
SELECT c.id, c.name, c.company, COUNT(o.id) AS orders,
SUM(o.total_cents) / 100.0 AS spent
FROM customers c
JOIN orders o ON o.customer_id = c.id
WHERE c.status = 'active'
AND o.status = 'completed'
GROUP BY c.id
ORDER BY spent DESC, c.name
LIMIT 8;
| idINTEGER | nameTEXT | companyTEXT | ordersvalue | spentvalue |
|---|---|---|---|---|
| 60 | James Green C | Westward | 2 | 1536.0 |
| 96 | Lucas Nguyen E | Index Studio | 2 | 1536.0 |
| 24 | Noah Williams B | Good Measure | 2 | 1536.0 |
| 108 | Jack Wilson F | Thread Office | 2 | 1128.0 |
| 72 | William Harris D | Foundry Collective | 2 | 1128.0 |
| 48 | Jack Wilson C | Thread Office | 2 | 784.0 |
| 12 | William Harris | Foundry Collective | 2 | 784.0 |
| 114 | Leo Patel F | Grain Works | 2 | 768.0 |
The first workflow: a query against the Workshop sample database and its result.
What you can do in it
Query Anvil covers the work you do in a database client every day: finding the right table, writing the query, changing a few rows carefully and getting data out.
Explore
- Search every table and view on a connection, or press ⌘K to jump straight to one.
- Filter rows across all columns and sort by any of them. Large tables load in bounded pages.
- Read a table’s columns, indexes and declared foreign keys, then follow a relationship into the next table.
Query
- A SQL editor with highlighting. Run the selection or the whole query from the keyboard.
- Cancel a query that’s taking too long. The app asks the database to stop it and waits for the answer.
- History keeps each statement with its connection and outcome. Save the queries you reuse, or open
.sqlfiles. - Every tab remembers the connection it was opened on, so clicking around the sidebar never retargets a query.
Change
Grid editing works on SQLite tables. On PostgreSQL and MySQL, write the SQL and it goes through the same review.
- Edit cells in the grid or fields in the record inspector. Edits stay on your computer until you review them.
- Review shows each UPDATE or DELETE with its values bound as parameters.
- Apply runs every staged row in one transaction, and each row must still match what you loaded.
- Row deletions are staged and reviewed the same way.
Keep
- Back up a SQLite database to a new file with SQLite’s own backup API. The copy is integrity-checked, and existing files are never overwritten.
- Export the loaded result page as CSV or JSON, or copy it as CSV.
- Query drafts and open tabs come back the next time you open the app.
PostgreSQL, MySQL, MariaDB and SQLite
Browsing and querying work the same way on every engine. Editing rows in the grid is available for SQLite tables. On PostgreSQL and MySQL you change data with SQL in the editor, where writes go through the same review.
| Capability | PostgreSQL | MySQL and MariaDB | SQLite |
|---|---|---|---|
| Connect | Host and port, optional TLS | Host and port, optional TLS | A database file on disk |
| Browse tables and views with filter, sort and paging | Yes | Yes | Yes |
| Columns, indexes and foreign keys | Yes | Yes | Yes |
| SQL editor, results, history and saved queries | Yes | Yes | Yes |
| Write review and typed confirmation | Yes | Yes | Yes |
| Cancel a running query | Cancel request | KILL QUERY | Interrupt |
| Production opened read only by | default_transaction_read_only | SET SESSION TRANSACTION READ ONLY | Read-only file open |
| Edit and delete rows in the grid | Use SQL in the editor | Use SQL in the editor | Staged, reviewed, one transaction |
| Native backup | Export result pages instead | Export result pages instead | To a new file, integrity-checked |
| Export the result page as CSV or JSON | Yes | Yes | Yes |
MariaDB connects through the MySQL adapter. Query Anvil works with these SQL databases only; it doesn’t connect to MongoDB, Redis or other document and key-value stores.
What happens when you press Run
One keystroke in a database client can empty a table. Query Anvil puts a few deliberate checks between your SQL and the server, and tells you which one stopped a statement.
-
It reads the statement first
Your SQL is parsed in the dialect of the connection and classed as a read, a write or high impact.
UPDATEandDELETEwithout aWHEREclause are high impact. So areDROP,ALTER, functions it doesn’t recognise and anything it can’t parse. -
Some commands never run from the editor
Manual transactions, file and scope commands such as
ATTACHandCOPY, session policy changes withSET, and MySQL executable comments are refused with a reason.BEGIN; Manual transactions are not supported in the query editor. Staged grid changes use their own atomic transaction. -
Production is read only at the database
Mark a connection as Production and it opens read only on the server side, not just in the app. Writes are stopped before they’re sent, and the database would refuse them anyway. For production, the app still suggests an account that only has read permissions.
PostgreSQL -c default_transaction_read_only=on MySQL SET SESSION TRANSACTION READ ONLY SQLite SQLITE_OPEN_READ_ONLY -
Writes wait for your approval
On a writable connection, a write opens a review with the connection name, database and environment above the full statement. High-impact statements stay locked until you type the connection name.
-
Grid edits check the original row
Each staged edit becomes a parameterised statement whose
WHEREclause matches every column you loaded. All of them run in one transaction. If any row changed or vanished in the meantime, the whole batch rolls back, so you never end up with half a change.UPDATE "main"."customers" SET "status" = ? WHERE "id" IS ? AND "name" IS ? AND "email" IS ? AND "company" IS ? AND "status" IS ? AND "created_at" IS ? AND "metadata" IS ?; -- 8 bound value(s); values are passed separately to SQLite -
You can stop a query
Cancel sends PostgreSQL a cancel request, runs
KILL QUERYon MySQL and interrupts SQLite. The app reports the query as stopped only once the database confirms it.
Your work stays on this computer
Query Anvil connects straight from your computer to your database. There’s no account and no telemetry, and nothing about your schema, data or queries is sent to us. Connection profiles, saved queries and history are stored locally. Saved passwords go to macOS Keychain or Windows Credential Manager, or you can use a password for the current session only.
Pay once. Keep every update.
Query Anvil costs US$70 for a lifetime license with every future update included. There’s no subscription, no renewal and no account to create.
Checkout is handled by Lemon Squeezy.
- Price
- US$70, one payment
- Updates
- All future versions included
- Runs on
- macOS and Windows
- Databases
- PostgreSQL, MySQL, MariaDB, SQLite
- Account
- None needed
Questions before you buy? Email Dwayne Charrington, who makes Query Anvil, at dwaynecharrington@gmail.com.