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
[P0][security] CREATE mode Save button runs CREATE TABLE directly without preview — no confirmation, no diff against existing schema #380
src/components/designer/TableDesigner.tsx:208-225 (handleSave) executes CREATE TABLE immediately on Save click in CREATE mode. The Preview SQL button (line 374-378) exists, but it's not the default. No modal, no diff against INFORMATION_SCHEMA.TABLES to detect "table already exists", no warning that this creates a new table. A user who picked the wrong database silently creates a table in the wrong schema.
src/components/designer/SQLPreviewDialog.tsx (already exists, unused in CREATE-mode default)
Repro
Connect to production DB
Open Table Designer in CREATE mode for the wrong database
Type a table name and columns
Click Create Table
Table is created in the wrong database without confirmation
Expected
Clicking "Create Table" opens the preview dialog with the generated SQL; clicking Execute runs it; Cancel aborts.
Proposed fix
In CREATE mode, open SQLPreviewDialog automatically on Save click; only execute on the dialog's Execute button. Skip the preview in alter mode (user has iterated). Add a "Don't ask again" preference in settingsStore.designer.skipPreviewInCreateMode. Scope: S.
Acceptance
Clicking "Create Table" opens the preview dialog with the generated CREATE TABLE SQL; clicking Execute runs it; Cancel aborts. Alter mode still saves directly.
Activity
fix(designer): show the CREATE TABLE before running it (#549)