very interesting and relevant podcast discussion!
.NET Rocks! Who Owns the Code with Richard Hundhausen and Brad Frazer
very interesting and relevant podcast discussion!
.NET Rocks! Who Owns the Code with Richard Hundhausen and Brad Frazer
power of AI assisted sw dev!
How I Got Postgres into a Single Binary · progrium
sqlite3-like CLI and local workflow to real minipg at a directory and immediately run queries, serve a Postgres endpoint, or launch programs with Postgres environment variables already configured.Immediate queries: Point minipg at a folder (which becomes the database directory on disk and can be copied, backed up, or deleted when unused) to run SQL right away (minipg ./mydb "select * from notes").
Server & wrapper modes: Run a temporary Postgres server (minipg serve ./mydb -p 5432) or wrap an application (minipg run ./mydb -- some-tool) so no background daemon is left behind when the command exits.
Real Postgres engine: Built as an actual Postgres server rather than a compatibility layer, compiling across macOS, Windows, and Linux.
Attempt 1 —
Attempt 2 — VM in a headless webview: Running an x86 emulator (
Attempt 3 —
Good fit: Local single-user tools, trying or self-hosting Postgres-only open source apps without Docker, using Postgres features (JSONB, full-text search, window functions, pgvector, PostGIS) in SQLite-style workflows, learning SQL, and throwaway databases for tests, local dev, or agents.
Not a replacement for: Cloud deployments, replication, or multi-user high-concurrency production workloads where standard Postgres is required.
GitHub - progrium/minipg: SQLite and PostgreSQL had a baby · GitHub
PostgreSQL as a single executable. No server setup, no Docker, and a .pgdb folder that holds the whole database: minipg app.pgdb opens a shell on it.
minipg embeds Docker Hub's postgres:18-alpine image and runs it with hyper9 (h9), used as a Zig library. h9's Linux personality runs Alpine's own Postgres binaries directly on the host's hypervisor, with h9's Plan 9 kernel answering their system calls. There's no Linux kernel to boot, no VM image, and no Docker.
Architecture: Uses
Single Directory DB (.pgdb): All data, configuration (minipg.toml), generated credentials, and locks are self-contained inside a .pgdb folder that can be easily moved or checked into development environments.
Requirements: Built with Hypervisor.framework on macOS.
| Command | Action |
minipg app.pgdb | Starts a psql interactive shell (initializes app.pgdb automatically if missing). |
minipg serve app.pgdb | Runs the Postgres database server in the foreground. |
minipg url app.pgdb | Displays the connection string (postgres://...). |
minipg run app.pgdb -- npm start | Launches your host app with DATABASE_URL pre-configured. |
minipg dump app.pgdb > dump.sql | Exports database schema and data to SQL. |
Status: Early research prototype.
Performance: On Linux (x86_64 without KVM), running on h9's native emulation backend incurs a 2x to 12x performance hit compared to native execution.
Architecture Limits: Windows ARM64 is currently unsupported.
sqlite3-like CLI and local workflow to real minipg at a directory and immediately run queries, serve a Postgres endpoint, or launch programs with Postgres environment variables already configured.Immediate queries: Point minipg at a folder (which becomes the database directory on disk and can be copied, backed up, or deleted when unused) to run SQL right away (minipg ./mydb "select * from notes").
Server & wrapper modes: Run a temporary Postgres server (minipg serve ./mydb -p 5432) or wrap an application (minipg run ./mydb -- some-tool) so no background daemon is left behind when the command exits.
Real Postgres engine: Built as an actual Postgres server rather than a compatibility layer, compiling across macOS, Windows, and Linux.
Attempt 1 —
Attempt 2 — VM in a headless webview: Running an x86 emulator (
Attempt 3 —
Good fit: Local single-user tools, trying or self-hosting Postgres-only open source apps without Docker, using Postgres features (JSONB, full-text search, window functions, pgvector, PostGIS) in SQLite-style workflows, learning SQL, and throwaway databases for tests, local dev, or agents.
Not a replacement for: Cloud deployments, replication, or multi-user high-concurrency production workloads where standard Postgres is required.