-
Notifications
You must be signed in to change notification settings - Fork 0
Output Formats
propq adapts its output to how you're using it: humans get tables, scripts get JSON, spreadsheets get CSV.
propq -s prod --sql "SELECT id, name FROM users"When stdout is a terminal, results render as a colored table with a summary line (✓/✗ per target). Output auto-pages through less -SRFX when it's long — search with /, scroll, quit with q.
Pager behaviour:
- Auto: pager only when stdout is a TTY and output is long.
-
--pager: force paging even when stdout is piped. -
--no-pager: disable entirely (e.g. inside scripts that capture output). - Honors the
PAGERenvironment variable (defaults toless -SRFX).
Machine-readable, stable schema — designed for AI agents and scripts.
propq --json --sql "SHOW TABLE STATUS" -s prodPer-target result object:
{
"server": "prod-eu-1",
"database": "shop_main",
"status": "OK",
"rows": {
"columns": ["id", "name"],
"rows": [["1", "alice"], ["2", "bob"]]
},
"affected": 0,
"elapsed": "12.3ms"
}| Field | Type | Description |
|---|---|---|
server |
string | Server name (config key) |
database |
string | Database targeted |
status |
string |
OK, ERR, or SKIP
|
rows |
object | Present for SELECTs: columns + rows (all values as strings) |
affected |
int | Rows affected (for DML) |
error |
string | Error message, present only when status is ERR
|
elapsed |
string | Per-target duration, e.g. "12.3ms"
|
propq servers --json emits the server list in the same structured style.
propq --csv --sql "SELECT id, name, email FROM users" -s prod > users.csvFlat CSV with a header row — opens directly in Excel/LibreOffice.
propq -s "www1|www6|www7" --sql "SELECT VERSION()" --streamPrints each result as it completes instead of waiting for all targets. On slow servers you see fast ones appear immediately. Works with any output format.
propq --historyShows recent queries from the local history store — the same history that pre-fills the editor in -e mode.
| Flag | Effect |
|---|---|
-o, --output FILE |
Write output to a file too (stdout still gets it) |
-N, --no-output |
Suppress result rows — summary only |
--no-error |
Drop error entries from the output |
--no-result |
Show only ✓/✗ status per target, no data rows |
-q, --quiet |
Suppress spinner and banner noise |
# CI check: just pass/fail signal
propq --json --dry-run --sql "DROP TABLE temp" -s prod
# Export for Excel
propq --csv -o users.csv --sql "SELECT * FROM users" -s prod
# Live tail-style monitoring
propq -s "www1|www6" --sql "SELECT COUNT(*) FROM sessions" --stream
# Quiet machine log line
propq -q --json -s prod --sql "SELECT 1" | jq -r '.[].status'Next: Safety
This wiki is community-maintained. Found something outdated? Open an issue on the repository.
propq — Async SQL executor for MySQL/MariaDB
- Home
- Installation
- Getting-Started
- Configuration
- CLI-Reference
- Output-Formats
- Safety
- Examples
- AI-Agents
- Development
External links