Persistence & Data
vibepg gives every instance one of two persistence modes when you create it. The choice is immutable — to switch, you destroy the instance and create a new one.
Persistent (default)
vibepg new demovibepg creates a named Docker volume (vibepg-pg-<name>-data) and mounts it at Postgres' data directory. Your data survives:
vibepg down/vibepg upvibepg restart- Docker daemon restarts and host reboots
vibepg rm(the volume is preserved unless you pass--with-volume)
Use this for project databases, anything you want to come back to, and anywhere a --ephemeral flag would be a footgun.
Ephemeral
vibepg new scratch --ephemeralNo Docker volume is created. The container's data lives only in the container's writable layer, which Docker discards on docker rm. When you vibepg rm scratch, the data is gone — there's nothing to clean up.
Use this for:
- One-off SQL exploration
- Test suites that should start from a known empty state
- Anything you'd otherwise prefix with "throwaway"
Switching modes
You can't switch persistence modes on an existing instance. The simplest path:
vibepg dump old-name --output snapshot.dump
vibepg rm old-name --with-volume # only if it was persistent
vibepg new old-name # or with --ephemeral
vibepg restore old-name snapshot.dumpRemoving data deliberately
vibepg rm is conservative by default — it removes the container and registry entry but leaves persistent volumes alone, so a typo doesn't cost you data.
vibepg rm demo # safe: data preserved on disk
vibepg rm demo --with-volume # explicit: data goneFor ephemeral instances --with-volume is a no-op (there's no volume to remove).
Inspecting Docker state
vibepg doesn't hide Docker — anything it creates shows up in regular Docker commands:
docker ps --filter name=vibepg-
docker volume ls --filter name=vibepg-If you remove a container or volume directly with docker, vibepg will report missing in vibepg ls. Recover by removing the registry entry: vibepg rm <name>.
When to use which
| Situation | Mode |
|---|---|
| Project database you'll come back to tomorrow | Persistent |
| Schema/migration scratchpad | Ephemeral |
| Local stand-in for a real environment | Persistent |
| CI-style test fixture you load and tear down | Ephemeral |
| Anywhere a stale dataset would mislead you | Ephemeral |