Skip to content

kling db

Every test, its own database.

kling db

A copy is a microVM born from a golden with Postgres already warm. Each one has its own password, known only to the host.

Terminal window
kling db golden -script scripts/db-golden.sh build -template crm-demo pg # the template, once
kling db up pg -name t1 # a ready copy, with its key
kling db connect t1 -psql # psql from the host
kling db fork t1 -n 4 # 4 copies of t1 as it is right now; all or nothing
kling db reset t1 # t1 comes out of the template again
kling db rm t1

64 out of 64 kling db up at once in 4.6 s, ~14 MiB of memory per copy. Measured with the AuraCRM golden.

Terminal window
kling db class -n 30 -prefix alumno crm-demo # alumno-01 … alumno-30
kling db class reset -prefix alumno # next exercise
kling db class rm -prefix alumno

Keys are not printed: -passwords FILE writes them to a 0600 file.

Engine What works
Postgres 16/17 everything
MariaDB up, fork, connect, rotate, reset, rm, branch, doctor, audit
Redis, SQLite up, fork, connect, reset, rm, doctor