Write & reuse SQL
Run SQL and inspect execution reports
For relational SQL, run a selection or document directly; use Custom Execution to review statement scope, parameters, policies and source-linked outcomes.
What this feature does
Choose the SQL range and editor target deliberately. Ordinary execution, reviewed Custom Execution and Terminal Mode follow different paths.
When to use it
Use ordinary execution for a reviewed query; choose Custom Execution when you need an exact statement scope, bound values, policy controls or a per-statement report.

Before you start
Open the SQL Editor with a reachable target. Custom Execution applies to supported relational targets; MongoDB uses its query-service text path and Redis uses native Terminal Mode.
Default shortcuts
These defaults depend on the active SQL Editor mode and focus. Ordinary execution, Custom Execution, cursor-statement execution and Terminal Mode have distinct scopes.
| Action | Windows / Linux | macOS | Focus and effect |
|---|---|---|---|
| Execute the selection or document | Ctrl+Enter | ⌘+Enter | In normal relational SQL mode, use the editor target and execute selected text, or the document when nothing is selected; no Custom Execution dialog opens. |
| Execute the statement at the cursor | Ctrl+Alt+Shift+Enter | ⌘+⌥+Shift+Enter | Only in normal relational mode; split and run the statement at the caret when a safe boundary is found. |
| Open custom execution options | Ctrl+Alt+Enter | ⌘+⌥+Enter | Open the reviewed Custom Execution dialog for supported relational targets; confirm Target, Run scope and SQL preview before Run. |
| Alternative normal-execution bindings | Ctrl+Shift+Return / Ctrl+Shift+Enter | ⌘+Shift+Return / ⌘+Shift+Enter | Same ordinary selection/document action; Return and Enter matching depends on keyboard and platform. |
| Open query execution history | Ctrl+Shift+H | ⌘+Shift+H | Open application query execution history, which is separate from the latest custom statement-outcomes report and saved SQL history. |
| Toggle Terminal Mode | Ctrl+Alt+Shift+T | ⌘+⌥+Shift+T | Switch SQL Editor layout to Terminal Mode where supported. Redis keyspaces require their native command path. |
| Submit a terminal command | Enter | Enter | Submit only the current Terminal Mode prompt command; it is separate from normal editor document execution. |
| Cancel terminal input / request interruption | Ctrl+C | Control+C | In Terminal Mode, physical Control+C on macOS cancels current input or requests worker interruption; it does not guarantee rollback. |
| View latest statement outcomes | No dedicated default | No dedicated default | After a custom or cursor-statement run, use View Last SQL Execution Report in the editor menu or the result-toolbar outcomes button. |
| Request custom-query cancellation | Cancel Query button | Cancel Query button | Use the progress dialog during a custom relational run; a driver may complete the active statement after the request. |
- Settings → Shortcuts shows configurable bindings; customized keys take precedence. Fixed dialog keys and mouse gestures may be managed by their own controls.
- On macOS, ⌘ means Command and ⌥ means Option. Function keys may require Fn. Delete means forward delete (often Fn+⌫ on a compact Mac keyboard); use the menu when Insert is unavailable.
How to use it
- In normal relational SQL mode, select text for an ordinary run, or leave nothing selected to run the document. Check the editor target before Execute Query (Ctrl+Enter / ⌘+Enter).
- To run only the statement containing the caret, choose Execute Statement at Cursor. If no safe statement boundary is found, select one complete database statement instead.
- For review controls, open Custom Execution... from the editor menu or use Ctrl+Alt+Enter / ⌘+⌥+Enter. Check Target, Run scope, the SQL preview, parameters, transaction/error policy and Timeout before Run.
- Inspect returned result tabs and the latest custom-run statement outcomes. A multi-statement or unsuccessful custom run opens the report; otherwise use its result-toolbar button. Double-click a report row to return to source SQL.
Run a selection or document normally
Ordinary relational execution follows the SQL Editor’s current selection, or the whole document when nothing is selected.
- Focus the SQL text and review the editor target. Select exactly the SQL you intend to run, or leave the document unselected only when the whole document is intended.
- Choose Execute Selected SQL / Execute Query in the context menu or press Ctrl+Enter / ⌘+Enter. The ordinary path does not show the scope/options dialog.
- Inspect the result tabs and feedback. For a reusable structured report, start a separate Custom Execution run rather than assuming this ordinary run created one.
- The editor asks for confirmation when its target differs from the active database tab; this is a location check, not a SQL safety review.
- MongoDB editor text uses its native query-service path. Redis relational SQL execution is unavailable; use the command line/Terminal Mode.
Run only the statement at the caret
Execute Statement at Cursor resolves one statement using the editor target dialect.
- Put the caret inside the intended relational SQL statement without selecting a different range.
- Choose Execute Statement at Cursor or use Ctrl+Alt+Shift+Enter / ⌘+⌥+Shift+Enter. Review the target confirmation if it appears.
- If the editor cannot identify one safe statement, select the complete database statement and use the ordinary selection path instead.
- This action does not rewrite the editor text or selection. It uses the custom worker with a fixed per-statement, stop-on-error request.
- Unsupported compound or client-side delimiter syntax may prevent reliable splitting.
Review Custom Execution scope
Custom Execution... shows the target and exact SQL preview before submitting a supported relational request.
- Right-click the SQL text and choose Custom Execution..., or use Ctrl+Alt+Enter / ⌘+⌥+Enter.
- Compare Target with the intended connection and database. Run scope offers Current statement and Entire script; Selected text appears when an editor selection exists and is initially chosen in that case.
- Read the SQL preview. Change scope before Run if it includes a statement you did not intend. The dialog blocks an empty or unresolvable scope.
- A selected range can contain multiple safely split statements. A query plan is a separate mode and accepts one statement.
- Custom execution is unavailable for MongoDB and Redis in the reviewed editor path.
- The capture shows Entire script selected and all three SELECT statements in the preview. It is a pre-Run dialog state; pressing Run and ordinary execution are not visible in this image.
Set values and execution policy
The dialog binds :name values and offers target-supported transaction, error and timeout controls.
- For a :name placeholder, fill the Value (JSON or text) cell. JSON scalars or containers are parsed; other input stays text. Review every value before Run.
- Use Commit each statement for independent commits. Choose One transaction for the script only when the target and statements allow it; this disables Continue after errors.
- Set On error to stop or, for per-statement mode, continue. Leave Timeout at No timeout or enter seconds; saved parameter sets require an explicit name and checkbox.
- Named values are passed as driver bindings. A saved set lives in this workspace’s local settings; a parameter-name screen blocks only obvious secret-like names, not sensitive values.
- Script transactions reject explicit transaction control, database-level operations and unsupported DDL/session statements. Server-side implicit DDL commits still need review.
- The pictured parameter grid is empty and “Do not load a saved set” is selected. The capture does not demonstrate placeholder binding, saved-set loading or another transaction/error policy.
Interpret cancel and timeout requests
The custom progress dialog requests driver interruption; the driver and server determine when the active statement stops.
- During a custom run, choose Cancel Query only when you intend to stop subsequent statements and request interruption of the active one.
- If Timeout is set, wait for the request and completion report; the deadline begins when the worker has an active connection.
- Read the report status, including completed after a cancel/timeout request, cancelled, timed out, not run or rolled back. Verify server state before retrying.
- A statement can complete after cancellation or timeout is requested. A request alone does not prove rollback.
- The ordinary execution path does not expose these Custom Execution policy controls.
Read outcomes and return to source
A custom run keeps the latest statement outcomes in this editor instance.

- After Run, inspect Statement, Source lines, Status, Rows, Time (ms) and Server message. Multi-statement and unsuccessful custom runs open the report automatically.
- For a single successful custom run, choose View Last SQL Execution Report or use the result-toolbar outcomes button.
- Double-click a report row to focus its source range in the editor. When PostgreSQL supplies a usable server error position, the caret can go to that character; otherwise it selects the statement range.
- The report belongs to the latest custom/cursor-statement run in the current editor. Ordinary execution and Tools → Query Execution History are separate paths.
- Go to SQL source on a result tab also requires a valid source range; report navigation does not mean an error was corrected.
- The companion local_mysql / test report shows three succeeded SELECT statements on source lines 1–3, returning 295, 1 and 1 rows. Its displayed times are one captured run, not a performance benchmark; report-row double-click navigation is not shown.
Use Terminal Mode separately
Terminal Mode submits one prompt command at a time and keeps a separate session transcript.

- Open Command Line Client or toggle Terminal Mode from the editor menu (default Ctrl+Alt+Shift+T / ⌘+⌥+Shift+T) where the mode can be changed. Redis keyspaces enter the required native command surface.
- Type a command at the current prompt and press Enter. Use help for available engine commands, history to display prior commands, or clear to reset the terminal display.
- Use physical Control+C on macOS (Ctrl+C on Windows/Linux) or Escape to cancel the current input or request interruption. Outside a required Redis keyspace, exit / quit returns to normal editor mode.
- Terminal Up/Down can show terminal commands alongside workspace saved SQL, but the two stores remain distinct; neither is the application Query Execution History.
- Redis SQL execution through the normal editor is rejected; native command availability depends on the selected engine. A Redis keyspace cannot leave its required Terminal Mode through exit/quit.
What to expect
An ordinary run follows the editor’s selected/document scope and shows its usual result feedback. A custom run retains per-statement statuses with source ranges for the latest run.
Limits and safety
- Custom Execution and cursor-statement splitting are relational-only. Unsupported client DELIMITER or compound bodies can prevent safe scope resolution; ordinary execution of one complete selection is the separate fallback.
- The structured SQL Statement Outcomes report belongs to custom/cursor-statement execution; ordinary execution does not establish that report. Tools → Query Execution History is a separate record.
- Cancel and timeout request interruption but cannot promise a statement stopped before completing. Script transactions require target support, and some DDL may commit outside the requested rollback scope.
If something goes wrong
- If the wrong SQL could run, cancel at the target confirmation or Custom Execution review and recheck the editor target, selection and preview before trying again.
- If no cursor statement is found, select exactly one complete database statement. Remove client-only delimiter commands from ordinary selection execution.
- If a report button is unavailable after ordinary execution, use Custom Execution for a structured report; check Tools → Query Execution History for separate query execution records.
- After cancellation or timeout, inspect the report and verify the database state before submitting anything again.