Skip to content

Configuration

Berkay Günaydın edited this page Aug 6, 2026 · 1 revision

Configuration

propq is config-oriented: all execution behaviour can be set in propq.toml, and CLI flags override the config when explicitly provided.

File search order

  1. -c PATH — explicit path via flag
  2. ./propq.toml — current working directory
  3. ~/.config/propq/config.toml — Linux/macOS %APPDATA%/propq/config.toml — Windows

Generate a starter file:

propq config generate            # writes to platform config dir
propq config generate -o my.toml # writes to a path
propq config generate -o -       # prints to stdout

Validate without touching servers:

propq config validate -c my.toml

Test connections too:

propq config check -c my.toml

[defaults] section

Key Default Description
timeout 30 Query timeout in seconds
concurrency 5 Global concurrency limit
no_transaction false Run in autocommit mode (no transaction wrapping)
force false Allow destructive SQL (DROP/TRUNCATE/DELETE/ALTER) without --force
dry_run false Preview target databases without executing
json false Output as JSON (default: table)
quiet false Suppress spinner and banners
editor vim Editor for --edit / --select modes. Falls back to $VISUAL$EDITOR → vim/nano/hx/micro when empty. Can be "code --wait" etc.
server "" Default regex filter for server names
dbfilter "" Default regex filter for database names (include)
exclude_db "" Default regex to exclude databases
confirm_without_filter true When no DB filter is set (neither CLI nor config), prompt for confirmation before targeting ALL databases. Set false to run directly.

[connections.NAME] sections

Each server is one table. The key (NAME) is what you filter on with -s and what propq servers displays.

Key Required Default Description
host Server hostname or IP
port 3306 TCP port
user MySQL user
password "" Password (see note below)
max_connections 3 Per-server semaphore — max concurrent connections to this server
tags [] String list for -t filtering (comma-separated, OR semantics)

Full example

[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.prod-eu-1]
host = "db1.example.com"
port = 3306
user = "myuser"
password = "mypassword"
max_connections = 3
tags = ["prod", "eu"]

[connections.prod-eu-2]
host = "db2.example.com"
port = 3306
user = "myuser"
password = "mypassword"
max_connections = 2
tags = ["prod", "eu"]

[connections.staging]
host = "staging.example.com"
port = 3306
user = "testuser"
password = "testpass"
# max_connections defaults to 3
# tags defaults to []

Security notes

  • Never commit real credentials. The repo ships propq.toml.example with placeholder values only; propq.toml is gitignored.
  • Prefer a dedicated, read-only MySQL user where possible.
  • Keep confirm_without_filter = true unless you know every query you run is safe on every database.
  • Destructive SQL stays blocked without --force even if force = true is not set — see Safety.

Next: CLI-Reference

Clone this wiki locally