db-inspector

Inspect AutomationOne PostgreSQL and SQLite databases for schema, migration, and backup issues.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Auto-one-Family/Automation-One --skill db-inspector
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-inspector
Source: https://github.com/Auto-one-Family/Automation-One/tree/main/.claude/skills/db-inspector
Command: npx skills add https://github.com/Auto-one-Family/Automation-One --skill db-inspector

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The DB Inspector provides focused, server-side diagnostics and safe cleanup for AutomationOne PostgreSQL/SQLite deployments, helping engineers quickly identify schema issues, migration gaps, orphaned records, retention problems, backup/restore status, and index or performance bottlenecks.

Core Features & Use Cases

  • Schema & Migration Checks: Verify Alembic migration state, missing columns, and unique/foreign key constraints that could break persistence.
  • Data Integrity & Orphan Detection: Find orphaned sensor and actuator configs, stale mock devices, and cascading delete risks before destructive actions.
  • Performance & Index Analysis: Inspect index usage, table bloat, sequential scans, and active connection patterns to guide tuning.
  • Retention, Cleanup & Backups: Audit configured retention jobs, run safe dry-run cleanups, and create or restore compressed pg_dump backups with explicit confirmation.
  • Operational Safety: Enforces SELECT-before-DELETE, dry-run defaults, and explicit user confirmation for destructive operations; avoids schema/code changes.
  • Use Case Example: When sensor readings stop persisting for a device, run migration and FK checks, inspect related sensor_data and esp_heartbeat_logs, detect orphans, and produce a remediation report.

Quick Start

Run a full database inspection on the AutomationOne Postgres container to check migration status, key table sizes, index usage, orphaned records, retention job health, and backup availability, then summarize findings with recommended next steps.

Frequently Asked Questions about db-inspector

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check Alembic migration gaps and schema inconsistencies in a PostgreSQL database?

Database inspection checks Alembic migration gaps by verifying the current migration state, detecting missing columns, and validating unique and foreign key constraints to identify schema inconsistencies that could break data persistence.

How do I safely detect and delete orphaned sensor records without risking cascading deletes?

Detect orphaned sensor records by running an orphan detection workflow that enforces SELECT-before-DELETE rules, uses dry-run defaults, and requires explicit confirmation before performing any destructive deletion actions to prevent cascading delete risks.

Can I use this database inspector to analyze index performance and table bloat in SQLite?

Yes, you can analyze index performance and table bloat in SQLite by inspecting index usage, sequential scans, and active connection patterns, which provides tuning guidance for both PostgreSQL and SQLite databases.

Does the database cleanup process support dry-run validation for retention jobs?

The database cleanup process supports dry-run validation by auditing configured retention jobs, running safe dry-run cleanups, and enforcing explicit user confirmation before executing any destructive retention operations.

Why does pg_dump backup validation require explicit confirmation and no schema changes?

Pg_dump backup validation requires explicit confirmation and enforces no schema changes to ensure operational safety, preventing unintended data loss when creating or restoring compressed backups.