SQL editor
Open one with Ctrl+T, from File → New SQL Query, or Tools → Query Console. The database selector at the top of the editor decides what the query runs against.
Running queries
| Action | How |
|---|---|
| Run everything | F5 or Ctrl+Enter |
| Run just part of it | Select the text first, then F5 — the button changes to Run selection |
| Stop a running query | Stop in the toolbar |
Separate multiple statements with ; and they run in order. The splitter understands DELIMITER, so stored procedures and triggers whose bodies contain semicolons execute correctly:
DELIMITER $$
CREATE PROCEDURE archive_old_orders()
BEGIN
DELETE FROM orders WHERE created_at < NOW() - INTERVAL 1 YEAR;
END$$
DELIMITER ;Reading the results
Results appear below the editor in a grid with the same features as the data grid: sorting, per-column filters, column visibility and copy-as.
Large results are fetched in pages. When a result is cut off, NabuSQL marks it as truncated rather than silently showing you part of the data. Results are cached on the backend, so paging through them and exporting them does not re-run your query.
Export Results writes the current result set to CSV, TXT, JSON, XLSX, ODS, XML or SQL — see Exporting data.
Execution plan
F6 or the Explain button runs EXPLAIN on the current statement and shows the plan. For a deeper view — a cost-weighted plan tree from EXPLAIN FORMAT=JSON — use the profiler.
Formatting
Ctrl+Shift+F reformats the statement with consistent indentation and keyword casing. It is purely cosmetic; it never changes what the query does.
History
The History tab keeps every query you have run, with its duration, row count and any error. It is searchable, and each entry has two buttons: Load puts it back in the editor, and the run button executes it immediately.
Clear empties the history after a confirmation.
Saving queries
Save stores the query under a name and it appears in the sidebar under Queries for the current database.
If the connection has a Queries folder configured, .sql files in that folder show up there too, marked read-only — see Moving connections and queries.
Editing a query visually
Query Builder opens the current statement — or the selection, if you have one — in the visual query builder, which reads the SELECT back into tables, joins and conditions you can drag around. Parts it cannot express are reported instead of dropped silently.
AI assistance
The AI button opens the assistant panel beside the editor, where you can describe a query in plain language and get SQL back. It is off until you configure a provider — see Setting up a provider.
