Skip to content

v0.3

Latest

Choose a tag to compare

@progrium progrium released this 17 Nov 18:36
be3015a

minipg: Use PostgreSQL like SQLite on command line

PostgreSQL as a single executable. No server setup, no Docker. A .pgdb folder holds the whole database, and minipg app.pgdb opens a shell on it.

minipg app.pgdb                     # psql shell (creates app.pgdb if missing)
minipg url app.pgdb                 # postgres:// URL for your app
minipg run app.pgdb -- npm start    # your app, with DATABASE_URL set
minipg dump app.pgdb > dump.sql     # and minipg restore app.pgdb dump.sql

minipg embeds Docker Hub's postgres:18-alpine and runs Alpine's own Postgres binaries with hyper9, directly on the host's hypervisor. There's no Linux kernel to boot, no VM image, and no container runtime.

Try it in your browser: the project page runs a shell with minipg in it. Create a table, insert, and select without setting up a server.

Read the Manual

Since v0.2 (if you're coming from the old postgres17-standalone)

  • New embedding runtime: Switched from v86 in headless webview using webframe to the hyper9 hyperkernel
  • 8,000x faster: Best case server boot went from 7 seconds to 800ms.
  • Full SQLite-inspired CLI: init, serve, stop, status, url, logs, exec, env, run, dump, restore, dbs, create/drop, default, passwd.
  • Postgres 18 and other majors: Default is now Postgres 18. init --pg 17 downloads postgres:17-alpine and caches it by digest. MINIPG_OFFLINE and MINIPG_REGISTRY are supported.

Known limits

minipg is early, and hyper9's Linux personality is young, so don't trust it yet with data you can't recreate.

  • WHP commits each machine's memory up front: 2 GB per server and 1 GB per running tool.
  • JIT is off, because the root drops LLVM.

See Known limits for the rest.