▸ Minipg: PostgreSQL As A Single Executable

1 min readXcode & Tools, Open Source

Jake Marsh

Jeff Lindsay made Postgres feel more like SQLite:

minipg is PostgreSQL as one executable, ready to use, with no server to configure. A .pgdb directory is the database: its data, config, credentials, and Postgres version all live inside it, and minipg app.pgdb opens a psql shell on it.

Kinda neat how it gets there. It runs the official Docker image’s Postgres binaries with his h9 runtime, straight on the hypervisor:

There’s no Linux kernel to boot, no VM image, and no Docker.

The commands are what you’d hope for:

Shell
minipg app.pgdb "select 1"          # one statement
minipg run app.pgdb -- npm start    # your app, with DATABASE_URL set

It runs on Apple silicon (through Hypervisor.framework), on Linux, and in a 35 MB browser demo. Lindsay’s own warning: “minipg is early, and h9’s Linux personality is young,” so don’t keep anything in it you can’t recreate yet. It’s MIT licensed.

Link: progrium.github.io/minipg