Query editor
Run, edit, and explore SQL with autocomplete, multi-tab, and one-click EXPLAIN.
For: everyone. The query editor is the screen where you spend the most time.
The query editor opens automatically when you connect. Type SQL, press Cmd+Return, and the result lands in the grid below.
Run a query
| Action | Shortcut |
|---|---|
| Run everything in the current tab | Cmd+Return |
| Run only the selected text | Cmd+Shift+Return |
| Cancel the running query | Cmd+. |
When nothing is selected, Cmd+Return sends the entire tab to the server. To run a single statement out of a longer file, select it first then Cmd+Shift+Return.
Tabs
Each tab is its own SQL buffer with its own result. Tabs are tied to a connection — switching connections opens a fresh tab against the new database.
| Action | Shortcut |
|---|---|
| New tab | Cmd+T |
| Close tab | Cmd+W |
| Switch to tab 1, 2, ... 9 | Cmd+1 through Cmd+9 |
Tabs survive app restarts. If you close QueryDeck mid-query, you'll find your draft when you reopen.
Autocomplete
Start typing a table or column name and the suggestion popup appears. QueryDeck is smart about scope:
- In a
FROMorJOINclause it suggests every table in the active schema. - After you've named a table in
FROM/JOINit limits column suggestions to that table only. Typeusers.and you get only the columns onusers. - In a
SELECTclause before aFROM, it suggests every column from every table you've referenced so far. - Keywords like
SELECT,WHERE,JOIN,GROUP BYcomplete in context.
Press Tab to accept a suggestion, Esc to dismiss the popup.
EXPLAIN ANALYZE in one click
Right-click anywhere in your query, choose Explain Query. QueryDeck runs EXPLAIN ANALYZE and renders the plan as a tree below the editor. Each node shows its cost, actual rows, and time spent. See Query Plan Visualizer.
Format SQL
Cmd+Shift+F reformats the current tab. Keywords go uppercase, indentation is normalized, statements are spaced. Useful when pasting unformatted SQL from a log or Slack thread.
Find and replace
Cmd+F opens the find bar. Cmd+Option+F opens find-and-replace. Both support regex.
Multi-cursor editing
Option+Click adds a cursor. Edit several lines at once when you're renaming an alias across a long query.
Auto-uppercase keywords
By default, QueryDeck auto-uppercases SQL keywords as you type. select becomes SELECT the moment you hit space. Turn it off in Settings → Editor if you prefer to write keywords yourself.
Comments
| Action | Shortcut |
|---|---|
| Toggle line comment | Cmd+/ |
| Block comment selection | Cmd+Option+/ |
PostgreSQL and MySQL both accept -- single-line and /* block */ comments.
Results below the editor
Every successful query writes a result tab below the editor. The grid:
- Scrolls virtually, so 100K rows feel instant
- Sorts by clicking a column header (ASC, DESC, none)
- Filters per column from the column menu
- Shows execution time and row count in the status bar
- Renders JSON inline (click to expand), dates with locale, booleans as checkboxes, NULL as a gray badge
To copy out of the grid, select cells and Cmd+C. To copy a row as an INSERT statement, Cmd+Shift+C. See Export for the file options.
Running multiple statements
Separate statements with ;. QueryDeck runs them in order and opens one result tab per statement. If any statement errors, execution stops at that point.
Refreshing the schema
If you've changed the schema outside QueryDeck (a migration in another window, or a CLI tool), press Cmd+R to refresh the sidebar tree and the autocomplete index.
What's next
- Query history to find a query you ran yesterday
- Snippets for the built-in diagnostic library
- Saved queries for your own named queries
- Ask in plain English when you'd rather describe what you want