docker_db
Query database containers or check their status: version, size, uptime. Works with PostgreSQL, MySQL/MariaDB, Redis, MongoDB, and SQLite; destructive statements require explicit confirmation.
Instructions
query runs a statement against a database container, status asks the database about itself — version, size, uptime. PostgreSQL, MySQL/MariaDB, Redis, MongoDB and SQLite are spoken to through the client the image carries. A database that refuses answers with its exit code, not with a failed call. A statement that destroys data needs # CONFIRMED-DESTRUCTIVE.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user | No | Database user. Default: the one the container was started with. | |
| query | No | Statement in the language of this database — SQL, a Redis command, a MongoDB expression. Required by action query, unused by status. A statement that destroys a database or a whole keyspace is refused until it carries # CONFIRMED-DESTRUCTIVE. | |
| action | Yes | query runs a statement and brings back what the client printed. status asks the database about itself: version, size, uptime, and whether it answers at all. | |
| format | No | How the client lays out rows. Default: table. Only PostgreSQL has a CSV flag. | table |
| profile | No | Which Docker host, by profile name. Default: the profile marked as default. | |
| project | No | Which compose project. Default: the project of the working directory. A name matching nothing is an error, not a fall back to every container on the host. | |
| service | Yes | Database service name as written in the compose file. | |
| database | No | Database name. Default: the one the container was started with. | |
| compose_path | No | Where the compose file is: the file itself, or the directory holding it. Needed only when no container of the host carries the project label — a project that was never brought up there. A directory holding several compose files is refused with their names rather than guessed through. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | ||
| query | No | ||
| action | No | ||
| engine | No | ||
| health | No | ||
| legend | No | What the words in this answer mean. A key names the field before the value — "state=running", "containers[].health=unhealthy" — and only the values this answer used are listed. | |
| memory | No | ||
| output | No | ||
| reason | No | ||
| stderr | No | ||
| uptime | No | ||
| details | No | ||
| message | No | ||
| project | No | ||
| service | No | ||
| version | No | ||
| warnings | No | ||
| exit_code | No | ||
| connections | No | ||
| clipped_bytes | No |