Skip to content

fix(designer): show the CREATE TABLE before running it - #549

Merged
EVWorth merged 1 commit into
mainfrom
fix/designer-create-preview
Sep 5, 2026
Merged

EVWorth merged 1 commit into
mainfrom
fix/designer-create-preview

Conversation

@EVWorth

@EVWorth EVWorth commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Closes #380.

What changed

Create Table went straight to the server. The generated statement is entirely the designer's own work — there's no diff to read, and nothing on screen shows what will run or which database it lands in — so the first sight of either was the schema tree afterwards. A Preview SQL button sat right beside it, unused by default.

Create Table now opens that dialog. Execute runs the statement, Cancel runs nothing, and Escape or a click outside closes it — all of which the dialog already did.

Alter mode keeps saving directly

As the issue asks, and it has the case for it: the form is the table, the diff is against what was loaded, and since #379 a destructive change on a production connection raises the store's own confirmation. Putting a second dialog in front of that would mostly train people to click through both.

One thing left out

The "Don't ask again" preference the issue also proposes. A switch that turns off a confirmation, shipped in the same change that adds the confirmation, mostly serves to undo it. Worth adding if the prompt turns out to be a nuisance in practice — not before, and not on speculation.

Tests

Five. Four fail against the previous version — preview opens instead of running, the statement is shown, Execute runs it, Cancel runs nothing. The fifth checks alter mode didn't pick up the extra step.

Three existing create-mode tests now click through the dialog. The path changed, so the tests follow it — flagging that rather than letting it pass as incidental churn.

1755 unit + 298 browser green, tsc/dprint/eslint clean.

Scope note

This one is a genuine safety improvement rather than something broken — nothing was lying or corrupting, and creating a table is additive and reversible. Worth doing, but I'd rank it well below the other designer P0s it was filed alongside (#377 narrowed columns, #379 half-applied schemas).

🤖 Generated with Claude Code

Closes #380.

Create Table went straight to the server. The generated statement is
entirely the designer's own work — there is no diff to read, and nothing on
screen shows what will run or which database it lands in — so the first
sight of either was the schema tree afterwards. A Preview SQL button existed
beside it, unused by default.

Create Table now opens that dialog. Execute runs the statement, Cancel runs
nothing, and Escape or a click outside closes it, all of which the dialog
already did.

Alter mode keeps saving directly, as the issue asks. It has the case for it:
the form is the table, the diff is against what was loaded, and since #379 a
destructive change on a production connection raises the store's own
confirmation. Adding a second dialog in front of that would train people to
click through both.

Left out: the "Don't ask again" preference the issue also proposes. A switch
that turns off a confirmation, shipped in the same change that adds it,
mostly serves to undo it. Worth adding if the prompt turns out to be a
nuisance in practice, and not before.

Five tests. Four fail against the previous version; the fifth checks alter
mode did not pick up the extra step. Three existing create-mode tests now
click through the dialog — the path changed, so the tests follow it.

Co-Authored-By: Claude Opus 5 <[email protected]>
@EVWorth
EVWorth merged commit 71905c7 into main Sep 5, 2026
10 checks passed
@EVWorth
EVWorth deleted the fix/designer-create-preview branch September 5, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant