feat(cli): manage configured databases #5

Merged
warkanum merged 2 commits from issue-3-cli-database-management into main 2026-09-21 08:54:45 +00:00
Member

Implements wdevs/pgsql-broker#3.

Summary:

  • adds db add, remove, disable, enable, and list commands
  • supports interactive add prompts with defaults from the last database or --from
  • supports flags for every database configuration field and non-interactive confirmation controls
  • preserves YAML comments and unrelated settings while editing database entries
  • skips disabled databases during broker startup

Verification:

  • go test ./cmd/broker ./pkg/... — PASS
  • go vet ./cmd/broker ./pkg/... — PASS
  • go build -o /tmp/pgsql-broker-verify ./cmd/broker — PASS
  • CLI smoke test exercised add, disable, enable, remove, and list — PASS
  • git diff --check — PASS
  • go test ./... — BLOCKED by integration PostgreSQL unavailable at 127.0.0.1:5433; unit/package tests passed
  • golangci-lint — unavailable as configured: installed v1.64.8 rejects repository v2 configuration

Branch: issue-3-cli-database-management
Commit: 7fb64961e7

Implements wdevs/pgsql-broker#3. Summary: - adds `db add`, `remove`, `disable`, `enable`, and `list` commands - supports interactive add prompts with defaults from the last database or `--from` - supports flags for every database configuration field and non-interactive confirmation controls - preserves YAML comments and unrelated settings while editing database entries - skips disabled databases during broker startup Verification: - `go test ./cmd/broker ./pkg/...` — PASS - `go vet ./cmd/broker ./pkg/...` — PASS - `go build -o /tmp/pgsql-broker-verify ./cmd/broker` — PASS - CLI smoke test exercised add, disable, enable, remove, and list — PASS - `git diff --check` — PASS - `go test ./...` — BLOCKED by integration PostgreSQL unavailable at 127.0.0.1:5433; unit/package tests passed - golangci-lint — unavailable as configured: installed v1.64.8 rejects repository v2 configuration Branch: issue-3-cli-database-management Commit: 7fb64961e7dc6590c083ffff4795ec986e4978b8
sgcommand added 1 commit 2026-09-19 03:12:28 +00:00
feat(cli): manage configured databases
Integration Tests / integration-test (pull_request) Failing after 1m52s
7fb64961e7
warkanum approved these changes 2026-09-20 12:27:00 +00:00
Owner

Resolve linting issues before i merge.
Run make lint
Running golangci-lint...
cmd/broker/db.go:358:2: rangeValCopy: each iteration copies 168 bytes (consider pointers or indexing) (gocritic)
for _, db := range dbs {
^
pkg/broker/config/dbedit.go:163:2: rangeValCopy: each iteration copies 168 bytes (consider pointers or indexing) (gocritic)
for _, db := range dbs {
^
2 issues:

  • gocritic: 2
    make: *** [Makefile:154: lint] Error 1
Resolve linting issues before i merge. Run make lint Running golangci-lint... cmd/broker/db.go:358:2: rangeValCopy: each iteration copies 168 bytes (consider pointers or indexing) (gocritic) for _, db := range dbs { ^ pkg/broker/config/dbedit.go:163:2: rangeValCopy: each iteration copies 168 bytes (consider pointers or indexing) (gocritic) for _, db := range dbs { ^ 2 issues: * gocritic: 2 make: *** [Makefile:154: lint] Error 1
Owner

@sgcommand refresh this pr with the laster changes in master

@sgcommand refresh this pr with the laster changes in master
sgcommand added 1 commit 2026-09-21 04:07:18 +00:00
Merge latest main and fix database command lint
Integration Tests / integration-test (pull_request) Successful in 41s
0f2e3aab26
Author
Member

Refreshed this PR with the latest main and addressed the requested lint findings.

Changes:

  • Merged latest origin/main (including merged PR #6) into issue-3-cli-database-management.
  • Fixed both rangeValCopy findings by iterating over database slices by index:
    • cmd/broker/db.go
    • pkg/broker/config/dbedit.go
  • Resolved the go.mod merge conflict while preserving the metrics dependencies from main.

Published commit: 0f2e3aab2618cc3cd8d7ebd9a56b0bbd46d36fa9
Remote branch SHA was verified to match.

Verification:

  • go test ./cmd/broker ./pkg/... — PASS
  • go vet ./cmd/broker ./pkg/... — PASS
  • go build ./cmd/broker — PASS
  • git diff origin/main...HEAD --check — PASS
  • make lint could not execute locally because the installed golangci-lint is v1 while this repository uses v2 configuration; the reported rangeValCopy findings are fixed in the branch.
Refreshed this PR with the latest `main` and addressed the requested lint findings. Changes: - Merged latest `origin/main` (including merged PR #6) into `issue-3-cli-database-management`. - Fixed both `rangeValCopy` findings by iterating over database slices by index: - `cmd/broker/db.go` - `pkg/broker/config/dbedit.go` - Resolved the `go.mod` merge conflict while preserving the metrics dependencies from `main`. Published commit: `0f2e3aab2618cc3cd8d7ebd9a56b0bbd46d36fa9` Remote branch SHA was verified to match. Verification: - `go test ./cmd/broker ./pkg/...` — PASS - `go vet ./cmd/broker ./pkg/...` — PASS - `go build ./cmd/broker` — PASS - `git diff origin/main...HEAD --check` — PASS - `make lint` could not execute locally because the installed golangci-lint is v1 while this repository uses v2 configuration; the reported `rangeValCopy` findings are fixed in the branch.
warkanum merged commit e728d9164e into main 2026-09-21 08:54:45 +00:00
warkanum deleted branch issue-3-cli-database-management 2026-09-21 08:54:46 +00:00
Sign in to join this conversation.