Minipg: PostgreSQL as a Single Executable

295 points · 47 comments on HN · read original →

Points and comments are a snapshot, not live.

Minipg packages PostgreSQL as a single executable using h9's embedded hypervisor.

Minipg is a single executable that runs PostgreSQL without a server to configure. A .pgdb directory holds the database: data, config, credentials, and version. Commands like `minipg app.pgdb` open a psql shell, starting a background server if needed. It embeds Docker Hub's postgres:18-alpine image and runs it with h9, a hypervisor tool used as a Zig library. h9's Linux personality runs Alpine's Postgres binaries directly on the host hypervisor without booting a Linux kernel or using Docker. Performance is about 2x slower than native for one client. The project is early and not recommended for production data.

What commenters are saying

Commenters see this as a clever showcase for h9, though use cases are debated. Many compare it to PGlite (WASM-based in-process Postgres), noting PGlite is lighter without virtualization. Some suggest it's ideal for testing or small self-hosted apps where Docker is overkill. One commenter notes apt install postgresql is simple for those experienced, while others counter that sqlite's simplicity wins for small projects. A few share alternatives like lite4mariadb or pgtestdb. The automatic idle shutdown is praised.