Motivation & Problem
In #608, a confirmation dialog was implemented for destructive DDL and DML operations (DROP TABLE, DROP DATABASE, TRUNCATE, DELETE without WHERE) via DestructiveSqlDetector.inspect(userSql) and showDestructiveQueryDialog. This guard was integrated into PostgresSqlWorkspace, MysqlSqlWorkspace, and SqliteSqlWorkspace.
However, ExtensionSqlWorkspace (lib/features/extensions/extension_sql_workspace.dart) was omitted. When running queries against extension-backed databases (such as ClickHouse or future custom driver extensions), destructive operations like DROP TABLE analytics.events are executed immediately without user confirmation, bypassing the AppSettings.confirmDestructiveOperations safety setting.
Proposed Scope
- In
ExtensionSqlWorkspace._execute():
- Check
AppSettings.instance.getConfirmDestructiveOperations().
- Inspect the SQL query using
DestructiveSqlDetector.inspect(userSql).
- If destructive, present
showDestructiveQueryDialog with the connection name and target object details.
- Proceed with
ExtensionDriverSession.instance.query(...) only if confirmed.
- Add widget tests verifying that destructive queries in
ExtensionSqlWorkspace prompt for confirmation and can be aborted or confirmed.
Acceptance Criteria
Motivation & Problem
In #608, a confirmation dialog was implemented for destructive DDL and DML operations (
DROP TABLE,DROP DATABASE,TRUNCATE,DELETEwithout WHERE) viaDestructiveSqlDetector.inspect(userSql)andshowDestructiveQueryDialog. This guard was integrated intoPostgresSqlWorkspace,MysqlSqlWorkspace, andSqliteSqlWorkspace.However,
ExtensionSqlWorkspace(lib/features/extensions/extension_sql_workspace.dart) was omitted. When running queries against extension-backed databases (such as ClickHouse or future custom driver extensions), destructive operations likeDROP TABLE analytics.eventsare executed immediately without user confirmation, bypassing theAppSettings.confirmDestructiveOperationssafety setting.Proposed Scope
ExtensionSqlWorkspace._execute():AppSettings.instance.getConfirmDestructiveOperations().DestructiveSqlDetector.inspect(userSql).showDestructiveQueryDialogwith the connection name and target object details.ExtensionDriverSession.instance.query(...)only if confirmed.ExtensionSqlWorkspaceprompt for confirmation and can be aborted or confirmed.Acceptance Criteria
DROP TABLE,DROP DATABASE, orTRUNCATEinExtensionSqlWorkspacetriggersshowDestructiveQueryDialogwhen confirmation is enabled.AppSettings.confirmDestructiveOperationsis disabled, queries execute without prompting.ExtensionSqlWorkspace.