Skip to content

Live schema editing: MongoDB support, and a dialog that says what will happen - #24

Merged
fgatti675 merged 5 commits into
mainfrom
feat/live-schema-editing
Aug 23, 2026
Merged

fgatti675 merged 5 commits into
mainfrom
feat/live-schema-editing

Conversation

@fgatti675

Copy link
Copy Markdown
Member

Follow-up to #21 and #23, both merged.

MongoDB was told it was unsupported

isSchemaEditingAdmin is a structural check — a driver either offers
planSchemaChange or it does not. The Mongo driver did not, so a Mongo project
fell back to the source-only editor, which is off in production.

A schemaless database is the one place where changing a collection against a
running backend cannot fail, and it was the one place it did not work.

planMongoSchemaChange is short by the whole of its difficulty: no table to
alter, so every change is applicable, nothing is refused, no statements. What
the changes carry is what happens to the data — removing a property on
Postgres is refused because it would drop a column; on MongoDB the field stays
in every document and the API stops serving it. The change says so rather than
leaving a reader to import the relational answer.

So the dialog stopped assuming Postgres

It claimed a database was being altered even when nothing runs against one —
true for MongoDB always, and for any change that only moves source. It reads the
plan now: no statements means "Ready to commit" and a button that says "Commit".

Narrow on purpose. "Commit" only when a plan is going ahead and has no
statements; a refused plan also has none, because it will not run, and labelling
that button "Commit" would name the change it is declining to make.

The destination is on screen before the button

Not in the receipt afterwards. A commit is landing somewhere, and which branch
is the one fact nobody can recover from being wrong about. owner/repo · branch
for a remote; the checkout's name for a local one.

Read on /status rather than on the plan — the plan is recomputed per keystroke
and this is a git call locally.

Verified

Driven in a browser: the dialog reads as intended, cancel writes nothing, the
destination is legible. 107 admin, 199 mongo, 2,833 server tests.

fgatti675 and others added 5 commits August 23, 2026 19:15
Live schema editing does not write a migration, and cannot: a migration is
Atlas's format with an integrity file, minted by an external binary against a
throwaway database, and a running server has neither. That much was already
true and already reasoned about.

What was missing is that it matters to somebody. `drizzle/schema.sql` is
committed, and it is exactly what `rebase db generate` diffs against, so the
migration is one command away — but nothing said so. A project that deploys by
replaying migrations would have its database changed, its repository updated,
and its *next environment* built without the change, having been told the change
was applied.

The plan and the result now carry `followUp`, and the panel shows it. Detected
by the presence of `drizzle/migrations` holding at least one `.sql`; an
unreadable directory counts as present, because staying quiet about a project
that may replay migrations is the failure this exists to prevent.

Silent when there is nothing to record — no DDL, or a project provisioned by
boot-ensure, whose collections *are* the schema.

Not answerable for a deployment committing to a remote repository, which is a
built bundle: those are provisioned by boot-ensure rather than by replaying
migrations, so the question does not arise.

Co-Authored-By: Claude Opus 5 <[email protected]>
…y happen

Two things, and the second follows from the first.

**MongoDB was told it was unsupported.** `isSchemaEditingAdmin` is a structural
check — a driver either offers `planSchemaChange` or it does not — and the Mongo
driver did not, so a Mongo project fell back to the source-only editor, which is
off in production. A schemaless database is the one place where changing a
collection against a running backend cannot fail, and it was the one place it
did not work.

`planMongoSchemaChange` is short by the whole of its difficulty: there is no
table to alter, so every change is applicable, nothing is refused, and there are
no statements. What the changes still carry is what happens to the **data**,
because that is where a reader imports the wrong intuition. Removing a property
on Postgres is refused because it would drop a column; on MongoDB the field
stays in every document that has it and the API stops serving it. Saying so is
the difference between knowing the data is there and assuming it is gone.

**So the dialog stopped assuming Postgres.** It described a database being
altered even when nothing runs against one — true for MongoDB always, and for
any change that only moves source. It now reads the plan instead of the engine:
no statements means "Ready to commit" and a button that says "Commit".

Deliberately narrow: "Commit" only when a plan is *going ahead* and has no
statements. A refused plan also has none — because it will not run — and
labelling that button "Commit" would name the change it is declining to make.
Unknown reads as the fuller action, which is the safer way to be wrong.

**And the destination is on screen before the button**, not in the receipt
afterwards. A commit is landing somewhere, and which branch is the one fact
nobody can recover from being wrong about. `owner/repo · branch` for a remote,
and the checkout's name for a local one — the leading directories of an absolute
path are the part nobody needs.

The branch is read on `/status`, not on the plan: the plan is recomputed on
every keystroke, and locally this is a git call.

Verified in the browser: the dialog reads as intended, cancel still writes
nothing, and the destination is legible.

Co-Authored-By: Claude Opus 5 <[email protected]>
Planning could fail — a dropped connection, a backend restarting — and the only
way forward was Cancel and start again: reopen the editor, re-enter the name,
re-add the property, re-open the review. For a transient failure that teaches
people to distrust the preview rather than the network.

The plan request is now separable from starting a review, so it can be issued
again against the same pending change. "Try again" appears only when planning
actually failed.

The review token moves with it, so a late answer to the *first* attempt cannot
land in the dialog after the second has replaced it.

Co-Authored-By: Claude Opus 5 <[email protected]>
I renamed the disclosure to "Statements that will run" when the dialog stopped
assuming Postgres, and left the spec asserting "SQL that will run". My own
rename, my own miss.

Rather than swapping one literal for another, this asserts what the preview has
to show whichever engine is behind it: the files it would commit and the message
it would write. The statements disclosure is legitimately absent on a change
that runs none — every MongoDB change, and any Postgres change that only moves
source — so asserting it would have pinned the spec to one engine again.

Co-Authored-By: Claude Opus 5 <[email protected]>
`Run E2E Test Suite` normally takes 4-5 minutes. On the last run it sat in that
step for 41 minutes without failing, and would have kept sitting: no job in this
workflow sets `timeout-minutes`, so GitHub's default of six hours applied. The
run reported "pending" throughout, which is indistinguishable from slow.

30 and 40 minutes, against observed medians of 13 and 15 (slowest successful
runs: 13.9 and 16.6). That is roughly 2x, so a genuinely slower run still
passes and only a hang is caught — a ceiling tight enough to false-fail would
be worse than none.

publish.yml and publish-runtime-image.yml have the same gap. Left alone here
because a release workflow's failure modes deserve their own look, not a number
picked while landing a schema-editing branch.

Co-Authored-By: Claude Opus 5 <[email protected]>
@fgatti675
fgatti675 merged commit 1ad04b7 into main Aug 23, 2026
2 checks passed
@fgatti675
fgatti675 deleted the feat/live-schema-editing branch November 7, 2026 20:33
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.

1 participant