Skip to content

feat(schema): the details and menu operations FR-4.2 and FR-4.3 ask for (#292, #293) - #642

Merged
EVWorth merged 1 commit into
mainfrom
feat/schema-details-and-menus
Sep 11, 2026
Merged

EVWorth merged 1 commit into
mainfrom
feat/schema-details-and-menus

Conversation

@EVWorth

@EVWorth EVWorth commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Stacked on #641.

Three of FR-4.2.1's eight categories were in the details panel — Columns, Indexes, DDL — and the rest had nowhere to appear, including the foreign keys the backend could already answer for. Most of FR-4.3's menu operations didn't exist at all.

Details panel

Gains Overview, Foreign Keys, Triggers, Partitions. Overview leads, because "how big is this and what is it" is the question someone opening a table has before any of the details — and it says the row count is approximate, because InnoDB samples it from the index and presenting it as exact invites someone to trust it for a count.

Foreign keys show the rules, not just the columns: whether deleting a parent row takes its children with it isn't visible anywhere else in the app. Triggers are filtered to this table, since the server has no per-table trigger query. A tab with nothing in it still appears — "this table has no foreign keys" is an answer, and a panel whose tabs change per table is one you can't learn.

Menus

INSERT template, rename, duplicate structure, truncate; and on a database: create, drop, set as default, statistics.

  • The Select item is named for the limit it uses. It said "Select Top 100 Rows" while using maxResultRows, which defaults to 1000 — wrong out of the box, wrong again for anyone who changed it.
  • The INSERT template opens in a tab rather than running. Every value is NULL; that's a starting point, not a statement anyone means to execute. It omits generated columns, which the server rejects an assignment to, and annotates each placeholder with its type. (VIRTUAL GENERATED / STORED GENERATED vs DEFAULT_GENERATED verified on a live server — the last is a default expression, and that column is assignable.)
  • Duplicate uses CREATE TABLE ... LIKE, not AS SELECT, which silently drops indexes and column attributes.
  • Statistics reads information_schema rather than counting rows. Counting every row of every table to fill a menu item is not a thing to do to a production server.
  • Dropping a database asks for the name to be typed. A misplaced click shouldn't be able to take every table in one.

A bug found while wiring it

The existing menus called resultStore.executeQuery(...).then(refresh). That returns as soon as it opens the production confirmation — so the refresh ran against unchanged data, and when the user did confirm, nothing refreshed at all. Schema changes now go through confirmDestructive and runStatement, which can be awaited, and the cache is invalidated only once the statement has actually run.

Also fixed: the DDL pane was pinned to vs-dark, so it stayed dark in a light window.

Verification

2604 unit + 341 browser tests. 27 new statement-builder tests, 19 on the menus (including that a declined confirmation runs nothing, and that the refresh waits for the answer), 9 on the new detail tabs.

Closes #292
Closes #293

🤖 Generated with Claude Code

@EVWorth
EVWorth force-pushed the feat/schema-events-and-drag branch from b0f2737 to 89ee608 Compare September 11, 2026 22:29
@EVWorth
EVWorth force-pushed the feat/schema-details-and-menus branch from c16b15a to 38b7fdf Compare September 11, 2026 22:29
@EVWorth
EVWorth force-pushed the feat/schema-events-and-drag branch from 89ee608 to 32e930a Compare September 11, 2026 22:33
@EVWorth
EVWorth changed the base branch from feat/schema-events-and-drag to main September 11, 2026 22:33
Three of FR-4.2.1's eight categories were in the details panel — Columns,
Indexes, DDL — and the rest had nowhere to appear, including the foreign keys
the backend could already answer for (#292). Most of FR-4.3's menu operations
did not exist at all (#293).

The panel gains Overview, Foreign Keys, Triggers and Partitions. Overview
leads, because "how big is this and what is it" is the question someone
opening a table has before any of the details, and it says the row count is
approximate — InnoDB samples it from the index, and presenting it as exact
invites someone to trust it for a count.

Foreign keys show the rules rather than only the columns: whether deleting a
parent row takes its children with it is not visible anywhere else in the app.
Triggers are filtered to this table, since the server has no per-table trigger
query to ask instead. A tab with nothing in it still appears — "this table has
no foreign keys" is an answer, and a panel whose tabs change per table is one
you cannot learn.

The menus gain an INSERT template, rename, duplicate structure, truncate, and
— on a database — create, drop, set as default, and statistics.

Some of the detail:

- The Select item is named for the limit it uses. It said "Select Top 100
  Rows" while using `maxResultRows`, which defaults to 1000: wrong out of the
  box, and wrong again for anyone who changed it.
- The INSERT template opens in a tab rather than running. Every value is NULL;
  that is a starting point, not a statement anyone means to execute. It leaves
  out generated columns, which the server rejects an assignment to, and
  annotates each placeholder with its type.
- Duplicate uses `CREATE TABLE ... LIKE`, not `AS SELECT`, which silently
  drops indexes and column attributes.
- Statistics reads information_schema rather than counting rows. Counting
  every row of every table to fill a menu item is not a thing to do to a
  production server.
- Dropping a database asks for the name to be typed. A misplaced click should
  not be able to take every table in one.

A bug found while wiring it: the existing menus called
`resultStore.executeQuery(...).then(refresh)`. That returns as soon as it
opens the production confirmation — so the refresh ran against unchanged data,
and when the user did confirm, nothing refreshed at all. Schema changes now go
through `confirmDestructive` and `runStatement`, which can be awaited, and the
cache is invalidated only once the statement has actually run.

Also fixed: the DDL pane was pinned to `vs-dark`, so it stayed dark in a light
window.

Co-Authored-By: Claude Opus 5 <[email protected]>
@EVWorth
EVWorth force-pushed the feat/schema-details-and-menus branch from 38b7fdf to a8e0a4f Compare September 11, 2026 22:38
@EVWorth
EVWorth merged commit 7c253ce into main Sep 11, 2026
12 checks passed
@EVWorth
EVWorth deleted the feat/schema-details-and-menus branch September 11, 2026 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant