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
[P1][ux] Preview pane doesn't warn about destructive statements (DROP/TRUNCATE/DELETE) #367
SQL import preview UX. Per docs/audits/import.md F5.
Problem
src/components/import/ImportDialog.tsx:170-195 renders parsed statements verbatim. A dump with DROP TABLE users or TRUNCATE users shows as plain text — no styling, no warning. User has to read every line of multi-thousand-statement dump before clicking Import.
Files
src/components/import/ImportDialog.tsx:170-195
src/lib/sql-import.ts (no statement classifier)
Repro
Create dump with DROP TABLE foo at line 50
Open ImportDialog
Observe plain-text rendering, no warning
Expected
Red destructive warning + require typing "import" to confirm.
Proposed fix
S: add classifyStatement(stmt) -> { kind, label } helper in src/lib/sql-import.ts. Flag DROP, TRUNCATE, DELETE FROM x (no WHERE), ALTER TABLE ... DROP COLUMN, UPDATE x SET ... (no WHERE). Render destructive rows with red AlertTriangle icon. Confirm button requires typing "import" if any are destructive.
Acceptance
Previewing dump with DROP TABLE foo shows red destructive warning; clicking Import requires typing "import" to confirm.
Closed by #654, with a note on the half that was not built.
The warning itself is there: the preview counts destructive statements up front and lists the first five in an amber panel above it, so a DROP TABLE at line 5,000 is visible without reading the file. #654 extends it — the dialog now reads only the first 512 KB (the file is run by the backend straight from disk) and says when the scan did not reach the end, rather than reporting "3 statements detected" for a two-gigabyte dump.
Not doing the "require typing 'import' to confirm" half. That gesture belongs to actions with no other guard and no undo — deleting a GitHub repository. Here there are two already: the amber list naming the statements, and the production gate, which raises its own dialog on a production connection. A third, typed, on every import — including loading a fixture into a local database twenty times a day — would be trained away within a week, and a reflex to type past a confirmation makes the two that matter easier to click through too.
Activity
fix(import): one escape table, and say what a dump will drop (#579)
EVWorth commentedon Sep 12, 2026
Closed by #654, with a note on the half that was not built.
The warning itself is there: the preview counts destructive statements up front and lists the first five in an amber panel above it, so a
DROP TABLEat line 5,000 is visible without reading the file. #654 extends it — the dialog now reads only the first 512 KB (the file is run by the backend straight from disk) and says when the scan did not reach the end, rather than reporting "3 statements detected" for a two-gigabyte dump.Not doing the "require typing 'import' to confirm" half. That gesture belongs to actions with no other guard and no undo — deleting a GitHub repository. Here there are two already: the amber list naming the statements, and the production gate, which raises its own dialog on a production connection. A third, typed, on every import — including loading a fixture into a local database twenty times a day — would be trained away within a week, and a reflex to type past a confirmation makes the two that matter easier to click through too.