-
Notifications
You must be signed in to change notification settings - Fork 0
Safety
propq is designed to run against production MySQL/MariaDB servers. Safety is baked in — destructive operations are blocked by default, and everything defaults to fail-closed.
DROP, TRUNCATE, DELETE, ALTER (and UPDATE) are blocked unless you pass --force:
# Blocked with an error
propq --sql "DROP TABLE temp" -s prod
# Allowed explicitly
propq --sql "DROP TABLE temp" -s prod --forceThe --force flag is the single source of truth — it overrides nothing else; without it the query never runs.
If you run without any database filter (-d / -D), propq would target every database on the matching servers. To prevent accidents, it prompts for confirmation first:
# propq.toml — disable the prompt only if you really mean it
[defaults]
confirm_without_filter = true # default: promptSkip the prompt per-run with --no-confirm.
By default, each target's SQL runs inside a transaction that commits on success and rolls back on error.
-
--no-transaction— autocommit mode (each statement commits immediately). Use only when the SQL manages its own transactions. -
--ask-for-commit— show a summary of targets first, then ask before committing:
propq -s www6 -a -d "300" --ask-for-commit \
--sql "DELETE FROM logs WHERE date < NOW() - INTERVAL 30 DAY"Preview exactly which servers/databases would be targeted — no SQL is executed:
propq --sql "DROP TABLE temp" -s prod --dry-runCombine with --json for a CI-safe preflight:
propq --json --dry-run --sql "DROP TABLE temp" -s prod| Behaviour | Default |
|---|---|
| Destructive SQL | ❌ blocked without --force
|
| No DB filter | 🔒 confirmation prompt (confirm_without_filter = true) |
| Run scope | per-server (fast), not per-database |
| Transactions | ✅ wrapped per target |
| New risky behaviour | always defaults to off (fail-closed policy) |
- Use a dedicated MySQL user with the least privilege needed.
- Never commit real credentials —
propq.tomlis gitignored; the repo only shipspropq.toml.examplewith placeholders. - Prefer
--dry-run+--jsonin scripts that touch production. - On flaky networks,
--retry Nretries failed databases with exponential backoff.
Next: Examples
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