Repository navigation
fix(designer): show the CREATE TABLE before running it - #549
Merged
Merged
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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