/tools

Data lifecycle and retention designer

Model hot/archive/retention stages, holds and dependency blockers. Explore declared sample rows or whole partitions, then export read-only SQL and a review runbook. No database is connected, no removal runs, and no legal retention period is inferred.

Save each form before exporting or changing views. Saving/selecting restores other unsaved forms. Undo keeps 20 revisions; export JSON before reloading. Sample flags, links and policy approvals are declarations, not inspected database evidence.

Lifecycle map

Blue: hot. Purple: warm. Teal: archive-age window until retention age. Archive windows overlap the total retained population. Holds can extend retention indefinitely and are excluded from steady-state estimates.

Dependency order and blockers

Policy and sample findings

    Sample scenarios

    Plan context

    Dataset retention policy

    Hot days ≤ archive age ≤ retention age. At the retention age boundary, only an explicitly unheld and sufficiently archived sample can become a candidate. Row policies use a DATE anchor; partition policies require finite [lower, upper) DATE boundaries. Manual/anonymization methods require separately designed procedures.

    Dataset dependencies

    CASCADE does not override a child’s hold or retention requirement in this planner. Held/unknown/manual children block parent candidates. SET NULL only bypasses a retained-child blocker when nullable and explicitly allowed; held children still block. Cycles and their dependent parents require manual ordering.

    Declared sample units

    A row sample represents one declared row. A partition sample represents a whole declared partition: hold=false and archived=true must cover every row. Blank dates/unknown flags force review. References bind sample IDs, not physical UUIDs. A blank nullable reference explicitly means no parent; missing required references conservatively block potential parent candidates.

    Open lifecycle plan JSON
    Scope, SQL and retention review

    Policies and sample graphs are design declarations. Retention days and approval references are not legal advice or verified obligations. Age uses exact Gregorian DATE days with an inclusive retention-age boundary. Partition age uses its exclusive upper boundary, so every modeled date is old enough before eligibility is considered. Missing/unknown holds and required archive verification prevent destructive candidacy. Held data can be archived only under a separately approved preservation/access process; the planner does not authorize it.

    The sample dependency model uses explicit row/unit references and propagates retained/held/archive/manual blockers up to parents. Unresolved child references conservatively block candidates in their possible parent dataset. Cycles and parents depending on them require manual ordering. This does not discover real foreign keys, unmodeled references or external copies. Deleting a dataset keeps dependent definitions/samples visible for repair.

    Row dry-run SQL only counts visible local candidates: finite DATE anchor at/before the cutoff, boolean hold IS FALSE, optional archive flag IS TRUE and no referencing child row. It conservatively excludes all child references even when simulation permits child-first deletion or unlinking. It does not generate DELETE, anonymization, detach/drop or scheduling commands. Inspect actual DATE/boolean/UUID fields, indexes, RLS, FK actions, triggers and complete dependency closure before planning execution. As-of is a $1 DATE parameter. RLS/privileges can hide candidates or child rows; counts are not authorization or completeness evidence. Re-check concurrent holds/archive/references inside a separately reviewed transaction.

    Schema inspection SQL reports actual columns and foreign keys; missing datasets yield no column rows and require review. Partition retirement and anonymization need the runbook and separate executable designs. Archive integrity/restorability, replicas, caches, exports, object stores, backups and future restores require explicit propagation/tombstone procedures. Removal from a live table does not establish complete erasure.

    Capacity is a steady uniform-arrival scenario. Holds, unknown anchors, indexes, WAL/free space/TOAST/compression, backups, replicas and archive duplication are excluded. Archive-window rows are part of the retention window, not an additive total. No measured storage claim is made.

    Limits: 1 MB, 30 datasets, 100 dependencies, 400 sample units, retention windows 0–365,000 days; daily rows are strings up to 10^18. Sample pages show 40 rows; JSON/CSV/runbook retain all samples. Names assume 63-byte identifiers. Undo keeps 20 revisions. No input storage/transmission or database execution.

    PostgreSQL constraints · Partition maintenance