Skip to main content

inv db health

Overview

Checks the health of the ra-infrastructure PostgreSQL database. Returns exit code 0 if the database is reachable and responding, exit code 1 otherwise. Use inv db status for more detailed information.

Usage

inv db health

Prerequisites

  • Repo: ra-infrastructure
  • Install: pip install -e ".[dev]" from cli/ directory
  • Database: PostgreSQL container running (via Docker Compose)

Examples

Quick health check

inv db health

Use in scripts (check exit code)

inv db health && echo "DB is healthy" || echo "DB is down"

Detailed database status

inv db status

Exit Codes

CodeMeaning
0Database is healthy and responding
1Database is unreachable or unhealthy
  • inv db status -- detailed database status (connections, size, version)
  • inv db watch -- continuous monitoring with email/webhook alerts
  • inv db stats -- database statistics (table sizes, row counts)
  • inv system selfcheck -- comprehensive infrastructure health check