Skip to content
SHC Docs

shc db purge

clear the control plane’s ephemeral rows (reports by default; --yes performs)

Clear ephemeral data from the control-plane database: the non-audit rows of event.

Without --yes this removes nothing. It reports the table as it stands, how it splits, and exactly what each rule would take, including the is_audit share, which is the majority of the table and is not ephemeral.

--before bounds it: --before 30d (also m/h/w) or an absolute date --before 2026-08-01 / --before 2026-08-01T12:00:00Z. Omitted, the bound is now: every eligible row.

--audit additionally deletes compliance records: the audit table and the is_audit rows of event. Deleted audit records are gone; there is no second copy. The audit pruner appends a signed checkpoint row first so the hash chain still verifies across the cut, but a pruned chain is weaker evidence than an unpruned one.

Deletion is batched and resumable: each batch commits on its own, so an interrupted run has removed a prefix and re-running continues.

shc db purge [flags]
shc db purge
shc db purge --before 30d
shc db purge --before 30d --yes
shc db purge --before 90d --audit --yes
--audit also delete compliance records (the audit table and the is_audit rows of event). Off by default
--batch-size int rows per delete statement (0 = the pruner default, 5000)
--before string clear rows older than this: a relative interval (30m, 6h, 30d, 2w) or a date (2026-08-01, RFC 3339). Omitted = no age bound
-h, --help help for purge
-y, --yes perform the deletion. Without it nothing is removed and this is a report
--config stringArray extra YAML config file to layer on top of auto-discovered config; repeatable, later files win
-d, --debug enable debug mode (default: $SHC_DEBUG)
-e, --environment string environment name (default: "prod", or "default" on an estate with no licence and no trial; $SHC_ENVIRONMENT and shc ctx -e override it, and the "master" tenant is always "default")
--exclude string comma-separated dotted paths to drop
--fields string comma-separated columns/keys to show (and their order)
--filter string comma-separated dotted paths to keep (drops everything else)
-o, --output string output format: tty|text|json|yaml (default: $SHC_OUTPUT)
-s, --stack string stack name (default: $SHC_STACK)
-t, --tenant string tenant name (default: $SHC_TENANT)
-v, --verbose verbose output (default: $SHC_VERBOSE)
  • shc db - inspect and maintain the control-plane database