
Async SQL executor for MySQL/MariaDB β run queries across multiple servers concurrently from the CLI.
# One-liner: run SQL on all prod databases
propq --sql "SELECT COUNT(*) FROM users" --server prod
# File with filter
propq -f migration.sql -d "^shop_"
# Pipe it
echo "SELECT NOW(), DATABASE()" | propq -s staging
# Stream results live
propq -s "www1|www6|www7" --sql "SELECT VERSION()" --stream
# CI-friendly JSON output
propq --sql "SHOW TABLE STATUS" -s prod --json
# See what would happen (dry run)
propq --sql "DROP TABLE temp" --dry-run
go install github.com/v0id00/propq/cmd/propq@latest
Download the latest binary for your platform from the releases page:
# Linux amd64
curl -L https://github.com/v0id00/propq/releases/latest/download/propq-linux-amd64 -o propq
chmod +x propq
./propq --version
# Linux 32-bit (x86)
curl -L https://github.com/v0id00/propq/releases/latest/download/propq-linux-x86 -o propq
chmod +x propq
# macOS (Intel)
curl -L https://github.com/v0id00/propq/releases/latest/download/propq-macos-amd64 -o propq
chmod +x propq
# macOS (Apple Silicon)
curl -L https://github.com/v0id00/propq/releases/latest/download/propq-macos-arm64 -o propq
chmod +x propq
# Windows 64-bit
curl -L https://github.com/v0id00/propq/releases/latest/download/propq-windows-amd64.exe -o propq.exe
# Windows 32-bit
curl -L https://github.com/v0id00/propq/releases/latest/download/propq-windows-x86.exe -o propq.exe
git clone https://github.com/v0id00/propq.git
cd propq
make build
# binary is in build/propq
propq completion bash | sudo tee /etc/bash_completion.d/propq
propq completion zsh | sudo tee /usr/local/share/zsh/site-functions/_propq
- β‘ Async execution β goroutine pool, per-server semaphores, default per-server mode (fast)
- π₯ 4 SQL sources β inline (
--sql), file (-f), pipe (stdin), editor (-e)
- π― Smart filtering β regex on server names (
-s), database names (-d), exclude (-D), tags (-t)
|- π Multiple output formats β table (human), --json (AI/scripts), --csv (Excel)
|- π Pager integration β auto-pages through less -SRFX for search & scroll; --no-pager to disable
- π‘οΈ Safety first β destructive SQL requires
--force, no-filter warning, --ask-for-commit
- π Retry β
--retry N with exponential backoff for flaky connections
- π Query history β
--history shows recent queries, editor template includes history
- π΄ Live streaming β
--stream prints results as they complete
- π File output β
-o file saves output to file (also prints to stdout)
- ποΈ Config-oriented β all behaviour configurable in
propq.toml, CLI overrides
- π Server list β
propq servers shows all servers with live DB counts
- π§ͺ Config check β
propq config check validates config and tests connections
- π€ AI agent ready β
--json for structured output, propq skill install for agent skill
# Configure servers
cp propq.toml.example propq.toml
# edit propq.toml with your server details
# List servers
propq servers
# Check config
propq config check
# Run a query (default: per-server mode, fast)
propq -s local --sql "SELECT VERSION(), NOW()"
# Run on all databases
propq -s local -a -d "^test" --sql "SELECT COUNT(*) FROM users"
# Interactive editor + DB picker
propq -e -S
# Save results
propq --json -o results.json --sql "SELECT * FROM users"
| Flag |
Description |
--sql QUERY |
Inline SQL |
-f, --file FILE |
Read SQL from file (- for stdin) |
-e, --edit |
Open $EDITOR to write SQL |
| Flag |
Description |
-s, --server REGEX |
Server name regex filter |
-d, --dbfilter REGEX |
Database name regex filter (include) |
-D, --exclude-db REGEX |
Database name regex filter (exclude) |
-t, --tags TAGS |
Filter by tags (comma-separated, OR) |
-S, --select |
Open editor to pick databases interactively |
| Flag |
Description |
--timeout SEC |
Query timeout (default: 30) |
--concurrency N |
Concurrency limit (default: 5) |
--retry N |
Retry failed databases N times |
--force |
Allow destructive SQL |
--dry-run |
Preview targets without executing |
-a, --all |
Per-DB mode (default: once per server) |
--no-transaction |
Autocommit mode |
--ask-for-commit |
Show summary, ask before executing |
| Flag |
Description |
--json |
JSON output |
--csv |
CSV output |
-o, --output FILE |
Save output to file |
--stream |
Print results live |
--history |
Show recent queries |
-N, --no-output |
Suppress results, show only summary |
--no-error |
Hide error entries from output |
--no-result |
Hide data rows, show only β/β per target |
--pager |
Force pager output (less) even when piped |
--no-pager |
Disable auto-pager (default: auto when stdout is a TTY) |
-q, --quiet |
Suppress banners and progress |
| Flag |
Description |
-c, --config FILE |
Config file path |
| Command |
Description |
propq servers |
List servers with DB counts |
propq config check |
Validate config + test connections |
propq completion SHELL |
Generate shell completion |
propq skill install |
Install AI agent skill |
Search order: -c PATH β ./propq.toml β ~/.config/propq/config.toml
[defaults]
timeout = 30
concurrency = 5
force = false
dry_run = false
json = false
quiet = false
no_transaction = false
server = ""
dbfilter = ""
exclude_db = ""
confirm_without_filter = true
editor = "vim"
[connections.SERVER_NAME]
host = "db.example.com"
port = 3306
user = "myuser"
password = "mypassword"
max_connections = 3
tags = ["prod", "eu"]
# Quick check (per-server mode, ~50ms per server)
propq -s "www1|www6|www7" --sql "SELECT VERSION()"
# Per-database with filter
propq -s www6 -a -d "^kwebticari_30" --sql "SELECT ps_no FROM tbpersonel LIMIT 5"
# Stream mode (results appear as they complete)
propq -s www6 -a -d "300" --sql "SELECT COUNT(*) FROM users" --stream
# CSV for Excel
propq -s local --csv --sql "SELECT id, name, email FROM users" > users.csv
# Save JSON to file
propq --json -o report.json --sql "SHOW TABLE STATUS" -s prod
# Ask before each database
propq -s www6 -a -d "300" --ask-for-commit --sql "DELETE FROM logs WHERE date < NOW() - INTERVAL 30 DAY"
# Retry flaky connections
propq -s "www1|www7" --retry 3 --sql "SELECT 1"
# Tags filter
propq -t prod --sql "SELECT COUNT(*) FROM users"
# Dry run + JSON (safe for CI/AI)
propq --json --dry-run --sql "DROP TABLE temp" -s prod
# Editor mode with query history
propq -e
# AI agent skill setup
propq skill install
SQL β Scanner β Config β Runner β Display β stdout
β
Filter (regex + tags)
β
Async executor (goroutines + per-server semaphore)
β
Result collection (with optional streaming)
- Scanner reads SQL from argument, file, pipe, or editor (with history)
- Config loads server connections from TOML (config-oriented)
- Filter applies
-s / -d / -D / -t regex and optional editor picker
- Runner executes concurrently with per-server semaphores, retries on failure
- Display formats results as table, JSON, or CSV
See CONTRIBUTING.md for guidelines, commit conventions, and the safety checklist. Bugs and feature requests go to issues; security issues go through the Security Policy.
# Build
make build
# Cross-compile all platforms
make build-all
# Install to $GOPATH/bin
make install
# Run tests
make test
# Run with args
make run ARGS="--sql \"SELECT 1\" -s local"
MIT