feat(cli): manage configured databases
Integration Tests / integration-test (pull_request) Failing after 1m52s

This commit is contained in:
SG Command
2026-09-19 05:11:50 +02:00
parent d3bce39783
commit 7fb64961e7
7 changed files with 985 additions and 2 deletions
+21
View File
@@ -369,6 +369,27 @@ The `databases` array can contain multiple database configurations. Each entry s
| `conn_max_idle_time` | Connection max idle time | `10m` |
| `queue_count` | Number of queues for this database | `4` |
| `tenant_id` | Tenant id set for this connection (RLS) | `default` |
| `auto_migrate` | Apply pending migrations during `start` | `false` |
| `disabled` | Exclude this database from `start` | `false` |
### Database Management Commands
The configuration can be managed without editing YAML by hand:
```bash
pgsql-broker db list --config broker.yaml
pgsql-broker db add replica --from db1 --host db.example --database jobs_replica --user broker --password secret --yes --non-interactive --config broker.yaml
pgsql-broker db disable replica --config broker.yaml
pgsql-broker db enable replica --config broker.yaml
pgsql-broker db remove replica --yes --config broker.yaml
```
`db add` accepts flags for every database setting. If a setting is omitted in
interactive mode, it is pre-filled from the last database in the file, or
from the instance named by `--from`; press Enter to keep that value. Use
`--non-interactive` to reject missing required values instead of prompting.
The add command asks for confirmation unless `--yes` is supplied. Remove also
requires `--yes` when stdin is not a terminal.
### Broker Settings