Commands
Type them after : (or Ctrl+K). Tab/Shift+Tab, ↑/↓ or Ctrl+N/Ctrl+P pick an entry, Enter runs it (a command that still needs its argument is completed instead), Esc or Backspace on an empty line closes. Text that is not a command searches the actions by name. A command that cannot run shows an error and the line stays open.
Editor commands (from the editor, : starts the line with '<,'> in Visual mode and with .,.+2 after a count of 3, as Vim does; the command runs in the active tab’s editor):
- A line range alone goes to its last line (the first non-blank):
:12,:$,:+3,:-,:'a. Addresses are a number,.,$,'x(a mark:'a-'z,'<,'>,'','.), each with+n/-n;a,b,a;b(the second counted from the first) and%(every line). :[range]s/pattern/replacement/[flags](:substitute) replaces in the range’s lines (the cursor’s line without one) as one undo step; the cursor goes to the last line changed. The pattern is a Rust regular expression, as in search (an empty one is the last search’s), and becomes the last search. The replacement is Vim’s:&or\0the match,\1-\9a group (an absent one is empty),~the previous replacement,\ra line break (\ntoo; in Vim it is a NUL),\ta tab,\u\lthe next character upper or lower case,\U\Lup to\Eor\e, a backslash before any other character that character (\&,\~,\\, the delimiter);$1is plain text. Flags:g(every match in a line),i/I(ignore case, or not),e(no error when nothing matches),&first (the last flags again);c(confirm) is not supported and says so. Any delimiter that is not a letter, digit, blank,\,"or|works (:s#a/b#c#).:salone and:&repeat the last:swithout its flags,:&&with them. Nothing matched: “Pattern not found”.:[range]formatformats the range’s lines (:'<,'>format,:%format);:formatwithout a range, andSpace e f(editor.format), format the statement under the cursor or the Visual selection. The formatter is never run on its own. It changes only the layout: where lines break, the indent ([editor] format_indent) and, if asked, the case of keywords ([editor] format_keyword_case). Names, strings, comments and dollar-quoted bodies stay as written. When its result would differ in anything else (an operator written apart, strings joined across a line break,U&'…', a psql\command) it changes nothing and says on which line. One format is one undo step.
An editor command closes the line; what went wrong is said in the status bar.
| Command | Aliases | Description |
|---|---|---|
:conn <profile> | :connect | Connect to a profile |
:set <setting>=<value> | Change a setting | |
:help | :h | Keyboard help |
:run | Run statement under cursor | |
:cancel | Cancel running query | |
:quit | :q | Close the tab (on the last tab: quit) |
:qall | :qa :quitall | Quit |
:w [name] | :write | Save (a console asks for a name; with a name: save as) |
:wq [name] | :x | Save, then close the tab (on the last tab: quit) |
:e [name] | :edit | Open a saved query |
:tabnew | New console tab | |
:tabclose | Close tab | |
:tabs | :ls :buffers | List tabs |
:tabmove [N / +N / -N / $] | :tabm | Move this tab (:tabmove N: after tab N, 0 first; +N / -N: N places; alone: last) |
:recover | Bring back a closed console (also from earlier runs) | |
:settings | Open the settings | |
:copy <format> | Copy the selected range, or every fetched row, as… (:copy <format> [selection|all]) | |
:use [db][.schema] | Choose this tab’s database and schema | |
:nohlsearch | :noh :nohl | Clear the search highlight in the editor (until the next search) and end the result grid’s search |
:suspend | :sus :stop | Suspend datarig (the shell’s fg brings it back) |
:format | Format the statement under the cursor or the selection (only its layout) | |
:ddl [schema.name] | Show the DDL of the explorer’s object, the table tab’s table, or a name (:ddl [schema.name]) | |
:monitor [profile] | Open the server monitor of the explorer’s or the active tab’s connection, or of one by name (:monitor [connection]) | |
:explain [analyze] | The plan of the statement under the cursor (:explain analyze runs and measures it; a write is rolled back) | |
:theme copy <from> <name> / new <name> / update [<name>] | Write a theme file: a full copy of a theme, a new one to fill in, or the tokens a file does not list | |
:export [format] [all / fetched / selection] [delim= quote= header= null=] [path] | Export the result to a file: alone, the export dialog; else every row by default, the format from the file’s extension (:export [format] [all|fetched|selection] [delim=… quote=… header=… null=…] [path]) | |
:commit | Commit the open transaction | |
:rollback | :rb | Roll back the open transaction |
:tx | What the open transaction did | |
:session | :startup | What a profile’s sessions start with, and where each setting comes from |
:changes | Show changes | |
:apply | Apply the pending changes (asked first) | |
:discard | Drop every pending change of the result | |
:whatsnew | What’s new: the release notes of this version and the ones before | |
:update | Update: what the update check knows, and how to update |
Settings of :set (saved to config.toml like the matching actions):
| Setting | Values | Description |
|---|---|---|
language | en ko auto | UI language |
icons | on off auto | Nerd Font icons |
secrets.default_source | auto keychain file command env prompt | Password storage of new profiles |
commands.position | popup bottom | Command line position |
detail_view | panel statusbar | Cell detail |
clipboard | auto system osc52 | Clipboard |
copy_header | auto on off | Column names in copies |
editor.cursor_shape | on off | Cursor shape |
editor.clipboard | on off | Yanks to the clipboard |
theme | terminal dark light high-contrast catppuccin catppuccin-latte catppuccin-mocha tokyo-night tokyo-night-day tokyo-night-night gruvbox gruvbox-light gruvbox-dark nord dracula or the name of a theme file | Theme |
editor.format_keyword_case | preserve upper lower | Formatter: keywords |
editor.format_indent | 4 2 | Formatter: indent |
editor.auto_pairs | off on | Auto-pairs |
editor.soft_tab_backspace | on off | Backspace to tab stop |
editor.run_hints | on off | Run hints |
secrets.macos_keychain_access | direct security_tool | macOS keychain access |
explorer.size_heat | 3 5 off | Explorer: size colours |
ui.yank_flash | on off | Flash copied cells |
ui.changes_view | list sql | Changes tab view |
edit.paste_null | \N NULL none | Paste NULL token |
ui.tips | always until_used off | Tips |
ui.background | theme terminal | Background |
idle_disconnect | off 5m 10m 30m 1h | Close idle connections |
lock_wait | off 5s 10s 30s 1m | Lock wait limit |
editor.completion_delay_ms | 60 0 30 100 150 250 | Completion delay (ms) |
updates.check | on off | Check for updates |
updates.whats_new | on off | What’s new |
copy_format | tsv csv json json_pretty markdown html xml insert | Format of y and Y copies |
monitor.interval | 1s 2s 5s 10s 30s 60s | Server monitor interval |