Summary
Stamp a TTL into the sandbox's clone comment at dbts up time. A sweep step (either on every dbts up or as a separate dbts sweep command) drops sandboxes whose TTL has expired and that belong to the current user.
Why
Sandboxes accumulate. Forgotten zero-copy clones don't cost much in storage but they pollute the database list and obscure the active set. A self-managed TTL avoids the "who owns this clone?" archaeology.
Sketch
- Extend the comment pattern:
dbts: cloned from <src> at <ts> by <user> ttl=<7d>.
- Update
COMMENT_PATTERN in clone.py to capture the TTL group.
dbts up --ttl 7d (or --ttl 2025-12-01) writes the TTL.
- Sweep policy: only drop databases owned by the current OS user (matched against the comment) — never drop someone else's sandbox.
- Run sweep automatically on
dbts up (cheap), or expose dbts sweep standalone.
Where it'd live
- Extend
src/dbts/clone.py (TTL parsing, sweep helper).
- Wire
--ttl flag into cmd_up.
Effort
Medium — needs the list command (#10) as a building block, plus careful "only drop your own" gating.
Tier
Tier 2 — lesser idea.
Related
Summary
Stamp a TTL into the sandbox's clone comment at
dbts uptime. A sweep step (either on everydbts upor as a separatedbts sweepcommand) drops sandboxes whose TTL has expired and that belong to the current user.Why
Sandboxes accumulate. Forgotten zero-copy clones don't cost much in storage but they pollute the database list and obscure the active set. A self-managed TTL avoids the "who owns this clone?" archaeology.
Sketch
dbts: cloned from <src> at <ts> by <user> ttl=<7d>.COMMENT_PATTERNinclone.pyto capture the TTL group.dbts up --ttl 7d(or--ttl 2025-12-01) writes the TTL.dbts up(cheap), or exposedbts sweepstandalone.Where it'd live
src/dbts/clone.py(TTL parsing, sweep helper).--ttlflag intocmd_up.Effort
Medium — needs the list command (#10) as a building block, plus careful "only drop your own" gating.
Tier
Tier 2 — lesser idea.
Related
dbts list(feat:dbts list— list all *_SANDBOX_* databases #10).