Keys and the command palette
Two keys get you far: one runs the statement under the cursor, the other finds any command by its name. Every other key is listed here, and each can be changed.
The command palette
Ctrl+P (⌘P on a Mac) opens the Command palette. Type a few words of a command and every word must appear in its name; Enter runs the one highlighted. A command that cannot run now is shown greyed, with the reason beside it, and each row carries its key when it has one.
The keys
On a Mac, Ctrl is ⌘ and Alt is ⌥.
| command | key |
|---|---|
| Run the statement under the cursor | Ctrl+Enter |
| Cancel a running statement | Ctrl+F2 |
| Explain the statement | Ctrl+Shift+P |
| Analyse the statement | Ctrl+Alt+P |
| Format statement | Ctrl+Alt+L |
| Find in console · Replace in console | Ctrl+F · Ctrl+R |
| Commit · Roll back | Ctrl+Alt+K · Ctrl+Alt+R |
| Apply · Revert the result’s edits | Ctrl+Shift+Enter · Ctrl+Alt+Z |
| Export the result | Ctrl+Shift+E |
| Show the cell value | Ctrl+Shift+V |
| New script · Open a SQL file… | Ctrl+N · Ctrl+O |
| Save · Save as… | Ctrl+S · Ctrl+Shift+S |
| Connections | Ctrl+Shift+C |
| Settings | Ctrl+, |
| Database panel · History · Diagnostics | Ctrl+Shift+B · H · D |
| Read the selected object again | F5 |
| Change the structure of the selected table… | Ctrl+F6 |
| Find what uses the selected object | Alt+F7 |
| Back · Forward | Ctrl+Alt+← · → |
| Next tab · Previous tab | Ctrl+PgDn · PgUp |
| Zoom in · out · reset | Ctrl+= · - · 0 |
Inside the console the editor keeps its own keys as well: undo and redo, select all, Ctrl+/ to comment a line out, Alt+↑ and ↓ to move a line, Shift+Alt+↓ to duplicate it and Ctrl+Shift+K to delete it. Run everything, Begin and Find in result have no key until you give them one.
Changing a key
Help → Keymap opens the Keymap page of Settings, with every command and its key. Click a key to change it, then press the new one; Escape leaves it alone and Backspace takes it away. A key another command already answers to is not taken, and a bare letter cannot be a key, though a function key can. Keys the editor binds inside the console carry a lock and cannot be given to anything else. Reset every key you changed puts them all back.