SQL Editor
The SQL Editor is VisuaLeaf's dedicated activity for writing, running, and iterating on SQL against your relational databases. It is built on CodeMirror 6, so you get fast syntax highlighting, dialect-aware autocomplete, multi-tab editing, and a rich result viewer that can switch between grid, tree, JSON, and explain-plan output on the same query.
Ctrl/Cmd + Shift + S).F5 to run the whole buffer, highlight a fragment and press F9 to run just the selection, or press Ctrl/Cmd + F5 to run up to the cursor.Each connection has its own SQL Editor context so tabs, history, and result sets stay scoped to the database you are working on:
SELECT against that table.The editor understands the SQL dialect of the current connection and adjusts keywords, functions, and quoting rules accordingly.
Trigger the completion menu with Ctrl + Space, or just keep typing:
FROM, JOIN, UPDATE, INTO.u. lists columns of the aliased table).COUNT, NOW(), COALESCE, JSON_EXTRACT.selectall, joinon, groupbycount, upsert.SELECT id, name, email
FROM users
WHERE active = true
ORDER BY created_at DESC
LIMIT 100;
The editor exposes several execution modes so you can iterate on part of a script without re-running everything:
| Action | Windows / Linux | macOS |
|---|---|---|
| Run entire buffer | F5 |
F5 |
| Run current selection | F9 |
F9 |
| Run up to cursor | Ctrl + F5 |
Cmd + F5 |
If your buffer contains several statements separated by ;, running the whole buffer produces one result tab per statement. The status bar shows the aggregate row count and total elapsed time.
Every executed query produces a result tab that can render in four modes:
Sortable, resizable columns with type-aware cell rendering (dates, JSON, NULL, booleans). Right-click a cell to copy, filter by value, or open a related row via a foreign key.
Expandable tree of rows and nested values. Great for wide result sets with lots of columns, or when a cell contains JSON you want to drill into without leaving the result panel.
Each row rendered as a JSON object. Handy for LLM prompts, API mocking, or piping to jq.
Runs the current statement through the dialect's EXPLAIN and renders the plan for inspection alongside the result.
When a stored procedure or a batch returns more than one result set, each appears as its own sub-tab under the result panel. Metadata rows (row count, elapsed) are shown per set.
Press Ctrl/Cmd + S to save the current buffer. Saved queries include:
:tenant_id) prompted at run time.Access saved queries from the Saved Queries sidebar entry or by typing @ anywhere in the editor.
| Shortcut | Action |
|---|---|
Ctrl/Cmd + T | New editor tab |
Ctrl/Cmd + W | Close current tab |
Ctrl/Cmd + S | Save query to library |
Ctrl/Cmd + / | Toggle line comment |
Ctrl/Cmd + Space | Trigger autocomplete |
Ctrl/Cmd + Shift + F | Format SQL |
F5 | Run entire buffer |
F9 | Run current selection |
Ctrl/Cmd + F5 | Run up to the cursor |
FROM clause first — autocomplete uses the alias immediately for the rest of the query.SELECT, highlight it, and hit F9 to preview intermediate results without touching the full query.:parameter placeholders instead of hardcoding IDs — VisuaLeaf will prompt at run time and never store the value in the saved query.Download and start managing your MongoDB databases with ease.
Download Free Trial