3. SQL editor

Open an SQL editor with SQL > New SQL editor (Ctrl+N), the toolbar button or by double-clicking a system table. Each editor has its own connection and transaction, so several editors on the same database do not interfere.

SQL editor

SQL editor

3.1 Toolbar

Command Description
Run (F9) Runs the selection, or the whole text if nothing is selected
Ctrl+Enter Runs only the statement under the cursor (statements are delimited by ; and blank lines; BEGIN ... END blocks are respected)
Run as script Runs the text as a script (supports SET TERM, several statements, COMMIT)
Stop Cancels the running statement
Commit / Rollback Ends the current transaction
Autocommit Commits every statement automatically
Isolation Read committed, Snapshot or Read only (applies from the next transaction)
Open / Save Loads or saves a .sql file; the tab title follows the file name
Max rows Maximum number of rows fetched

Statements run in a background thread: the interface stays responsive and Stop is always available.

3.2 Code assistance

The editor (Monaco, the editor of Visual Studio Code) provides SQL syntax highlighting, formatting and find/replace, plus context-aware completion:

The schema used for completion is reloaded automatically after DDL statements. Completion is also active in the procedure, function, trigger and view editors and in the script runner.

3.3 Results grid

Results appear in the Results tab. The bar above the grid shows whether the result is editable and why not (for example a view without a primary key).

Editable results

Editable results

Record view

Record view

Right-click on a cell opens the grid menu:

The message area under the grid shows execution statistics (time, fetched rows, page reads/writes, indexed and sequential reads).

3.4 Execution plan

The Plan tab shows the execution plan of the last statement, as a tree on Firebird 5 (explained plan) and from the monitoring tables on Firebird 3 and 4. It is not available on Firebird 2.5.

Execution plan

Execution plan

3.5 History

Every statement executed is saved in a per-connection history. The History tab lists statements with date, rows and duration; repeated executions of the same statement are grouped.

Query history

Query history

Type in the filter box to search, then use Append to editor, Replace editor, Copy, Delete or Clear history. Double-click or Enter inserts the statement in the editor.

3.6 Snippets and templates

New table template

New table template