You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
execute_sql runs DELETE / UPDATE without WHERE inside a CTE without the destructive confirmation #563
With a client that supports elicitation, execute_sql asks for confirmation before delete from films. When the same operation is in a WITH query, it runs without asking. isDestructiveSql only checks whether a statement starts with drop|delete|truncate or update, so a statement that starts with WITH is never classified as destructive.
To reproduce
isDestructiveSql from packages/mcp-server-supabase/src/tools/destructive-sql.ts, main @ 9092ab9, v0.17.0:
query
result
delete from films
asks
with x as (select 1) delete from films
runs
with d as (delete from films returning *) select count(*) from d
runs
with u as (update films set title = 'x' returning *) select 1
runs
Expected behavior
All three WITH queries ask for confirmation, like the first query does.
Notes
#426 parses SQL and covers "operations in executing CTEs", and #532 reports the related MERGE case. Since #426 is still open, I can add a small fix on the current regex path with tests for these cases, if that's useful until the parser lands. Happy to follow whichever approach you prefer.
Activity