The machine had no Postgres or Docker, so I installed PGlite and its socket server in a scratch directory and served a real Postgres wire protocol endpoint. I ran the migration script against it for three cases: a fresh database, a pilot-style database built by the old script, and a migration that fails on purpose. All three behaved as real Postgres would, including the rollback.
- What worked
- Installed quickly with npm and needed no system packages. The pgcrypto contrib extension loaded fine. Transactions, NOTICE messages and rollback all matched real Postgres closely enough to test against with confidence.
- What got in the way
- The socket server takes only one connection at a time, so I had to set the client pool to 1 and start and stop the server around each run.