From 1d123243ef9a5d74605588cdce8c552897e2788d Mon Sep 17 00:00:00 2001 From: Renz Date: Fri, 24 Oct 2025 19:09:58 +0000 Subject: [PATCH] Docs: add PostgreSQL/MySQL option guidance --- QUICKRUN.MD | 14 ++++++++++++++ README.md | 16 ++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/QUICKRUN.MD b/QUICKRUN.MD index f6f3215..e781781 100644 --- a/QUICKRUN.MD +++ b/QUICKRUN.MD @@ -155,6 +155,20 @@ dbbackup backup cluster --jobs 16 --dump-jobs 8 --max-cores 32 | `--jobs` | Parallel jobs | `--jobs 8` | | `--debug` | Debug mode | `--debug` | +### PostgreSQL Quick Options + +- Default target is PostgreSQL; explicitly add `--db-type postgres` when switching between engines in scripts. +- Run as the `postgres` OS user for local clusters: `sudo -u postgres dbbackup ...` ensures socket authentication succeeds. +- Pick an SSL strategy: omit `--ssl-mode` for local sockets, use `--ssl-mode require` (or stricter) for remote TLS, or `--insecure` to disable TLS. +- Cluster backups (`backup cluster`) and plain `.dump` restores are PostgreSQL-only operations. + +### MySQL / MariaDB Quick Options + +- Select the engine with `--db-type mysql` (or `mariadb`); supply `--host`, `--port 3306`, `--user`, `--password`, and `--database` explicitly. +- Use `--insecure` to emit `--skip-ssl`; choose `--ssl-mode require|verify-ca|verify-identity` when TLS is mandatory. +- MySQL dumps are gzipped SQL scripts (`*.sql.gz`); the restore preview shows `gunzip -c ... | mysql` so you know the exact pipeline. +- Credentials can also come from `MYSQL_PWD` or option files if you prefer not to use the `--password` flag. + ## 📁 Available Binaries Choose the right binary for your platform: diff --git a/README.md b/README.md index d59fec3..0f85dca 100644 --- a/README.md +++ b/README.md @@ -254,6 +254,22 @@ dbbackup cpu | `--ssl-mode` | SSL mode | `prefer` | `--ssl-mode require` | | `--insecure` | Disable SSL | `false` | `--insecure` | +### PostgreSQL Options + +- Use the built-in `postgres` role whenever possible (`sudo -u postgres dbbackup ...`) so `pg_dump`/`pg_restore` inherit the right permissions. +- `--db-type postgres` is the default; include it explicitly when running mixed test suites or automation. +- `--ssl-mode` accepts PostgreSQL modes (`disable`, `prefer`, `require`, `verify-ca`, `verify-full`). Leave unset for local socket connections or set to `require` for TLS-only environments. +- Add `--insecure` to force `sslmode=disable` when working against local clusters or CI containers without certificates. +- Cluster operations (`backup cluster`, `restore`, `verify`) are PostgreSQL-only; the command will validate the target type before executing. + +### MySQL / MariaDB Options + +- Set `--db-type mysql` (or `mariadb`) to load the MySQL driver; the tool normalizes either value. +- Provide connection parameters explicitly: `--host 127.0.0.1 --port 3306 --user backup_user --password **** --database backup_demo`. +- The `--password` flag passes credentials to both `mysql` and `mysqldump`; alternatively export `MYSQL_PWD` for non-interactive runs. +- Use `--insecure` to emit `--skip-ssl` for servers without TLS. When TLS is required, choose `--ssl-mode require|verify-ca|verify-identity`. +- MySQL backups are emitted as `.sql.gz` files; restore previews display the exact `gunzip | mysql` pipeline that will execute once `--confirm` support is introduced. + ### Environment Variables ```bash