Repository navigation
Conversation
With `DATABASE_URL` set, the run creates a Postgres database of its own on
that server, as before; without it, the run uses `{ kind: "pglite" }` and
needs no Postgres. `makeDbTransport` picks the transport from
`DatabaseOptions`, for `makeDb` and the simulation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kyscott18
force-pushed
the
test/sim-pglite
branch
from
November 2, 2026 21:22
935debb to
c9a76bc
Compare
kyscott18
force-pushed
the
test/sim-db-transport
branch
from
November 2, 2026 21:22
251d2c2 to
174406f
Compare
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.
Last of four stacked PRs, on #114: PGlite transport → sim DB as a transport with injected errors → PGlite for the sim. (#112 is merged.)
DATABASE_URLunset: the run uses{ kind: "pglite" }(feat(typewriter): add an in-memory PGlite database transport #113's in-memory transport) and needs no Postgres. Nothing is left behind after a run.DATABASE_URLset: the run creates a Postgres database of its own on that server, as before. It's dropped on a pass and kept, with itspsqlcommand, on a failure. This keeps the production Bun SQL driver covered, and gives a database to inspect when a seed fails: rerun it withDATABASE_URL.makeDbTransport(options)picks the transport fromDatabaseOptions, formakeDband the sim.Bun loads
.envfrom the working directory, so apackages/typewriter/.envcopied from.env.examplesetsDATABASE_URLand selects Postgres.BOM. PGlite reads a text value that starts with U+FEFF without it (see #113). The sim stores no strings since #111, so it is unaffected.
Speed. PGlite isn't faster per run. Measured on
0x01before the split:PGlite.create()(WASMinitdb) takes ~770 ms, against 38 ms forCREATE DATABASE.initdbsnapshot (loadDataDir, ~185 ms in a fresh process) would remove most of the startup gap if PGlite sweeps become common.Checked, sequentially:
0xe 0x11 0x41 0xd5 0xa0 0xcdpass on both PGlite and Postgres with identical summaries (virtual time, submissions, blocks, batches), equal to test(sim): mock the database as a transport, with injected rollbacks #114.reorgRate: [0]patch,0x01passes with 43 injected rollbacks and matches test(sim): mock the database as a transport, with injected rollbacks #114 on Postgres (virtual time, submissions, blocks, batches).🤖 Generated with Claude Code