Skip to content

[P0][security] CREATE mode Save button runs CREATE TABLE directly without preview — no confirmation, no diff against existing schema #380

Closed

Description

@EVWorth

Context

Table Designer Create Table action.

Problem

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.

Files

  • src/components/designer/TableDesigner.tsx:208-225 (handleSave)
  • src/components/designer/SQLPreviewDialog.tsx (already exists, unused in CREATE-mode default)

Repro

  1. Connect to production DB
  2. Open Table Designer in CREATE mode for the wrong database
  3. Type a table name and columns
  4. Click Create Table
  5. 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.

Needs human verify

no

Doc drift

no

Activity

  1. added
    audit
    severity/p0
    kind/security
    area/designer
    on Jul 31, 2026
  2. added a commit that references this issue on Sep 5, 2026
    71905c7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/designerauditkind/securityseverity/p0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions