SQLLens.AI Docs
Reference

Keyboard shortcuts

VS Code keybindings for run, optimize, and favorites — plus @ mention shortcuts you type in the SQL editor to open command libraries, starred SQL, and query history.

Animated demo: Run SQL and EXPLAIN from the editor.
F9 Run SQL — editor, results, and EXPLAIN in one flow.
Animated demo: Optimize from CodeLens above a statement.
Optimize and related CodeLens shortcuts above the active statement.

Overview

SQLLens.AI shortcuts fall into two groups:

  1. Keybindings — Ctrl/⌘ chords bound to extension commands (run query, optimize, new file, …).
  2. @ mention shortcuts — type in the SQL editor (no chord); autocomplete opens a filtered list. Accept with Enter or Tab, dismiss with Esc.

Run Show MySQL Shortcuts (mysql.shortcuts.show) from the Command Palette to open the live list of keybindings. That list reflects your OS and any overrides in VS Code.

For the full autocomplete guide (all @ channels, JOIN ON, Query Builder tokens), see SQL autocomplete — @ mention channels.

@ mention shortcuts (SQL editor)

Type @ at the start of a line or after ;, then a channel keyword. Add words after the keyword to filter (for example @dba long). Channels are progressive: @f → @fa → @fav narrows as you type each letter.

ShortcutAliasesWhat you getExample filter
@com@command, @cmd, @sql, @c (MySQL/MariaDB; on PostgreSQL @c is psql \c, not commands)Engine command library — session settings, metadata, maintenance templates@com process → processlist-related commands
@dba(same catalog as @com)DBA runbook commands — long queries, locks, processlist, diagnostics@dba long → long-running query templates
@fav@favorite, @favorites, @fStarred SQL from the Favorites panel (names and shortcut keys match)@fav payroll → favorites matching “payroll”
@fre@frequent, @frequentlyMost-run queries on this connection (by execution count)@fre select → frequent SELECT templates
Accept & navigate
  • ↑ ↓ — move highlight in the list
  • Enter or Tab — insert the selected row (replaces the whole @… span)
  • Esc — close the list without inserting
  • Keep typing after the channel word to fuzzy-filter labels

Slash variants at line start work the same way for favorites and history: /fav, /history (see slash shortcuts). /fre is not favorites — it maps to frequent queries.

Default keybindings

Below, ⌘ is macOS; on Windows and Linux use Ctrl instead (where the command names match).

ActionDefaultCommand
Run statement under cursor⌘+↵mysql.runQuery
Run all in file⌘+Shift+↵mysql.runAll
Open Visual Explain⌘+Alt+Omysql.optimize
New SQL file⌘+Alt+Nmysql.newSqlFile
Tree search⌘+P then dbmysql.treeSearch
Insert favorite⌘+K, Fmysql.favorite.insert

Customizing

Open Preferences → Keyboard Shortcuts (⌘+K ⌘+S), search for the command id, and rebind. VS Code overrides take precedence over the defaults shipped with SQLLens.AI.