feat(dashboard): admin storage stats page #78
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/admin-storage-stats"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds an admin-only Storage page at
/admin/storageshowing overall database size plus per-table row counts and on-disk sizes (data incl. TOAST, indexes, total, avg bytes/row).pg_stat_user_tables, so new tables appear automaticallyCOUNT(*)per table (estimates lag until autovacuum; all tables here are small)humanBytesunit cases🤖 Generated with Claude Code
Automated review by pr-reviewer v0.37.0 | Safety Check | Claude Sonnet 5 | tracking id
r-61e792-0be69fThis is an AI-generated review and may contain mistakes.
Status: ✅ Completed
✅ Verdict: LGTM — Straightforward admin storage stats page addition with safe identifier handling and no exposed secrets or breaking changes.
Reviewed the diff:
handleStorageis properly gated by admin route grouping and handles nil stats (degraded mode) safely.StorageStatsquery: table/schema names come frompg_stat_user_tables(catalog), not user input, and are further passed throughpgx.Identifier{}.Sanitize()before being interpolated intoSELECT COUNT(*) FROM <ident>— this avoids SQL injection since identifiers aren't user-controlled and are sanitized regardless.humanBytes/divInt64template funcs are simple and guarded against divide-by-zero, with template using{{if .Rows}}guard too.COUNT(*)loop could be slow on much larger tables, but PR explicitly notes all tables are small; not a correctness issue.Nothing here looks like an accidental commit, security issue, or breaking change.