The SQL editor shows a confirmation window just before running a statement that deletes data in bulk or removes a table. This page explains the window's look and buttons, and which confirmation applies to each execution path. The overall picture of which safeguard applies to which execution is in Safeguards for production databases.
What's on the screen
| No. | Name | Description |
|---|---|---|
| 1 | Title | The Dangerous Operation title when there is a TRUNCATE, DROP or ALTER … DROP, and the Confirm Execution title when there are only UPDATE or DELETE statements without WHERE. |
| 2 | Reason | Why the window appeared: the reasons in the table below, followed by Execute this statement?. When several statements run, the beginning of each matching statement is shown too. |
| 3 | Don't ask again for this type on this connection checkbox | If checked when you run, this type is not asked again on the same connection until the app restarts (on the web, until the page is reloaded). Other connections and other projects are not affected. It starts unchecked. |
| 4 | Cancel button | Closes the window without running. The focus is on this button when the window opens, so pressing Enter without reading the window does not run the statement. |
| 5 | Execute button | Runs the statement. |
The statements that bring up the window and their reasons are as follows.
| Statement | Reason |
|---|---|
A statement starting with TRUNCATE | TRUNCATE statement |
A statement starting with DROP (all of them, such as DROP TABLE, DROP VIEW and DROP PROCEDURE) | DROP statement |
An ALTER that removes something, such as ALTER TABLE … DROP COLUMN | ALTER … DROP statement (drops a column, constraint, etc.) |
UPDATE without WHERE (including one that starts with WITH) | UPDATE without WHERE clause |
DELETE without WHERE (including one that starts with WITH) | DELETE without WHERE clause |
- Text inside comments and strings is ignored. A
WHEREinside a subquery does not filter the target rows, so it does not count as aWHERE. - It appears on every connection, regardless of the connection profile.
Confirming and running
- In a SQL tab, put the cursor in the statement and click the Execute button (
Ctrl+Enter,Cmd+Enteron macOS). If the statement has bind parameters, the window for entering values opens first (Bind parameters), and the statement with the values filled in is checked. - When the window appears, read the reason and check that the statement in the editor and the tab's run target (connection, database, schema) are right.
- To run it, click the Execute button; to stop, click the Cancel button. Clicking outside the window or pressing
Escdoes not close it.
Before showing the window, the following checks run in order. A check that blocks stops without asking, so a statement is never blocked after you confirmed it.
| Order | Check | If it applies |
|---|---|---|
| 1 | Role-based DDL restriction (account projects) | Does not run, and shows the DDL execution is restricted. Please request the approver to apply it to the DB. notice |
| 2 | Protection mode of the connection profile | Blocks if read-only; if confirm, shows the window in 'The protection mode confirmation' below |
| 3 | Dangerous SQL confirmation | Asks. If step 2 already shows a window, both are asked in that one window |
The protection mode confirmation
On a connection whose profile protection mode is Confirm (DDL + risky DML), this window appears before DDL and UPDATE or DELETE without WHERE run. The Staging and Prod environments start in this mode (Connection profiles).
- The title (1) is the environment's English name in capitals and the connection name, as in
[PROD] shop-db. For a profile whose environment is Custom, the PROTECTED label takes the environment's place. - The reason (2) is Schema change (DDL) on a protected connection. for DDL and UPDATE/DELETE without a WHERE clause on a protected connection. for
UPDATEorDELETEwithoutWHERE. If the statement also triggers the dangerous SQL confirmation, that reason is shown in the same window. - It runs only when you click the Execute button (3). The initial focus is on the Cancel button. This window has no Don't ask again for this type on this connection checkbox, so a type you stopped confirming is still asked on protected connections.
- When you run several statements with the Run Script button, the matching statements are gathered and you are asked once before running. The line below the reason is Run this script?.
- Paths outside the SQL editor that write to the database, such as applying result edits or applying an ERD to the database, ask in the same window. The button there is the Apply button, and the line is Apply these changes to the database?.
How read-only connections block statements
On a connection whose protection mode is Read-only (block non-SELECT), running a statement that is not a query does not run it and shows a red notice at the top of the screen. No window asks you anything.
| Statement | Notice |
|---|---|
| DDL | DDL statements are blocked on read-only connections. |
| Other statements that change data | Statements that change data are blocked on read-only connections. |
- The Run Script button does not run the script at all if any statement is blocked.
- A statement that also triggers the dangerous SQL confirmation, such as
DELETE FROM coupon, is blocked right away without that window. - Whether a statement is a query is decided by looking into its body. The rule is explained in Safeguards for production databases.
Confirmations on each execution path
The dangerous SQL confirmation appears when you run with the Execute button of the SQL editor (including the shortcut and Execute Statement in the editor's right-click menu) and with the Run Script button. Protection mode applies to every path that writes to the database.
| Execution path | Dangerous SQL confirmation | Protection mode |
|---|---|---|
| The Execute button | Appears | Applies |
| The Run Script button | Appears. Matching statements are gathered and asked once | Applies |
| Applying result grid edits (including choosing to apply when closing a tab, and the data tabs of tables and objects) | Does not appear. The Preview Data Changes window shows the SQL to run first | Applies |
| Applying an ERD to the database, saving a table, changing and deleting objects in the explorer | Does not appear. Each screen shows the SQL to run first | Applies |
| Importing data from files, restoring dump files | Does not appear | Applies |
| SQL run by the AI Assistant panel | Does not appear | Applies |
| SQL sent by external MCP clients | Does not appear | Applies to every statement |
Things to keep in mind
- The dangerous SQL confirmation looks only at the shape of the statement. A statement that changes every row despite having a condition, such as a
DELETEwithWHERE 1=1, runs without the window. - If you select several statements and click the Execute button, the selected text is sent at once, but each statement is checked. If any one of them applies, you are asked.
- When changing data on a production database, turn off the Auto Commit switch, run, check the result and then commit (SQL execution and transactions).
Related screens
- Safeguards for production databases: which executions the dangerous SQL confirmation, protection mode and role-based DDL restriction apply to.
- Connection profiles: the tab where you set the protection mode and environment.
- SQL editor: the Execute and Run Script buttons.
- Editing result data: check and run the change SQL in the preview window.