Goldens and images with extensions
No initdb. No migrations. Already warm.
The golden is a microVM with Postgres already booted, loaded and warm. Each copy picks up where it was frozen: no initdb, no migrations, no postmaster startup.
kling db templates # empty, crm-demokling db golden build -template crm-demo crm # a golden in one commandkling db golden build -seed-mb 20 pg # or with a ~20 MiB table-migrations DIR applies the .sql files in order and -seed loads data, as the application role.
On macOS
Section titled “On macOS”kling run -image toolchain -egress internet -allow-exec -mem 1G -cpus 2 -name pgbasekling exec pgbase -- apk add postgresql16 postgresql16-client postgresql16-contrib tzdatakling save pgbase pg16basescripts/db-golden.sh build -from pg16base -seed-mb 20 pgMeasured on an M4 Mac: kling db up leaves a ready copy with its key rotated in 526–562 ms (the first one, cold, 1.0 s).
Extensions Alpine does not ship
Section titled “Extensions Alpine does not ship”kling db golden image -ext # pg16-ext: all fivekling db golden image -ext -pg 17 # pg17-extkling db golden build -from pg16-ext -as-super -migrations init/ <golden>| Extension | Version |
|---|---|
| timescaledb (TSL, with compression) | 2.30.2 |
| vector (pgvector) | 0.8.0 |
| postgis | 3.6.4 |
| pg_cron | 1.6.8 |
| pg_partman | 5.5.0 |
Each source is cloned by tag and checked by commit.