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]"fromcli/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
| Code | Meaning |
|---|---|
0 | Database is healthy and responding |
1 | Database is unreachable or unhealthy |
Related Commands
inv db status-- detailed database status (connections, size, version)inv db watch-- continuous monitoring with email/webhook alertsinv db stats-- database statistics (table sizes, row counts)inv system selfcheck-- comprehensive infrastructure health check