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

Query AnvilSearch objects and commands…⌘K
customersTop customersWorkshop
Run⌘↵ Workshop · main
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;
Results8 rows · read-only result
Query results
idINTEGERnameTEXTcompanyTEXTordersvaluespentvalue
60James Green CWestward21536.0
96Lucas Nguyen EIndex Studio21536.0
24Noah Williams BGood Measure21536.0
108Jack Wilson FThread Office21128.0
72William Harris DFoundry Collective21128.0
48Jack Wilson CThread Office2784.0
12William HarrisFoundry Collective2784.0
114Leo Patel FGrain Works2768.0
ConnectedSQLitemainSafe modeLoaded 8 rows

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 .sql files.
  • 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.

What Query Anvil supports on each database engine
Capability PostgreSQL MySQL and MariaDB SQLite
ConnectHost and port, optional TLSHost and port, optional TLSA database file on disk
Browse tables and views with filter, sort and pagingYesYesYes
Columns, indexes and foreign keysYesYesYes
SQL editor, results, history and saved queriesYesYesYes
Write review and typed confirmationYesYesYes
Cancel a running queryCancel requestKILL QUERYInterrupt
Production opened read only bydefault_transaction_read_onlySET SESSION TRANSACTION READ ONLYRead-only file open
Edit and delete rows in the gridUse SQL in the editorUse SQL in the editorStaged, reviewed, one transaction
Native backupExport result pages insteadExport result pages insteadTo a new file, integrity-checked
Export the result page as CSV or JSONYesYesYes

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.

  1. 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. UPDATE and DELETE without a WHERE clause are high impact. So are DROP, ALTER, functions it doesn’t recognise and anything it can’t parse.

  2. Some commands never run from the editor

    Manual transactions, file and scope commands such as ATTACH and COPY, session policy changes with SET, 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.
  3. 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
  4. 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.

  5. Grid edits check the original row

    Each staged edit becomes a parameterised statement whose WHERE clause 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
  6. You can stop a query

    Cancel sends PostgreSQL a cancel request, runs KILL QUERY on 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.

Get Query Anvil

US$70 once. Lifetime access and all future updates included.

Online checkout opens on this page shortly. Questions in the meantime? Email dwaynecharrington@gmail.com.