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. A ; inside the body of a routine is not a statement boundary, and every engine solves that differently — the splitter handles all four ways, so procedures, functions and triggers execute as written:
| Mechanism | Engine |
|---|---|
DELIMITER // | MySQL and MariaDB. The directive itself is consumed by NabuSQL and never sent to the server, which would reject it |
$$ … $$ | PostgreSQL dollar quoting — everything between matching tags stays one literal |
GO | SQL Server batch separator, recognised only on SQL Server connections; elsewhere GO is an ordinary identifier |
BEGIN … END | All engines. Nesting is tracked, and END IF / END LOOP / END WHILE close their own construct rather than the block |
DELIMITER $$
CREATE PROCEDURE archive_old_orders()
BEGIN
DELETE FROM orders WHERE created_at < NOW() - INTERVAL 1 YEAR;
END$$
DELIMITER ;Because BEGIN … END is understood on its own, the same procedure also runs when pasted without the DELIMITER wrapper — as does a T-SQL procedure or a SQLite trigger.
GO may carry a repeat count (GO 5). NabuSQL consumes the count and runs the batch once; repeating it is a sqlcmd feature and is not implemented. GOTO is never treated as a separator.
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, in the order the grid is sorted. It always exports the whole result, not a selection — see Exporting a query result.
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.
Right-click a saved query for Copy SQL, Duplicate — which saves it again as <name>_copy1 — and Delete query. Select several with Ctrl-click or Shift-click and the same three act on the whole selection. Queries that come from a .sql file cannot be deleted from here, but they can be duplicated, which writes a new file into the folder.
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.
