sqb janitor with preview and confirmation.
Physical version protection
Physical version relations are never deleted while referenced by:- Any active (non-detached) VDE’s current refs
- Any retained checkpoint’s refs
Checkpoint retention
Checkpoints are retained according to[janitor] max_checkpoints (default: 20):
Expired VDE cleanup
Non-active, non-detached VDEs older than[janitor] retention_days are pruned:
Detached VDE cleanup
Detached VDEs (created bysqb state detach) are eligible for cleanup after retention_days:
retention_days = 0makes them eligible immediately- Refs, function refs, and VDE row are deleted
- Checkpoint rows remain governed by checkpoint retention
- Physical versions newly unprotected by removed refs can be deleted in the same run
State cleanup
The janitor also prunes state-only artifacts:- Migration backups: old backup schemas are deleted, but the latest backup is always preserved
- Expired locks: lock rows with
expires_atin the past are deleted; active locks are never touched

