Skip to content

Commit 4099cee

Browse files
authored
Feat/implement phase d (#3)
1 parent 66a5d07 commit 4099cee

11 files changed

Lines changed: 805 additions & 100 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111

1212
- Phase A skeleton: Go module, Cobra CLI with placeholder subcommands, Bubble Tea TUI placeholder, Driver interface + registry, errs package, config stub, Makefile, golangci-lint with depguard, CI workflow.
13+
- Phase B Postgres walking skeleton: `backup`, `restore`, `sync`, `verify`, `inspect`, `dumps`, and `profile` working end-to-end against PostgreSQL (shelling out to `pg_dump`/`pg_restore`, pgx for inspect), SHA-256 dump checksums with sidecar metadata, named profiles with `env:` secret refs, and POSIX exit-code taxonomy.
14+
- Phase C interactive TUI dashboard: multi-panel Bubble Tea UI (profiles · dumps · jobs) with live job-progress subscription, backup/restore modal forms, an error overlay, and golden snapshot tests.
15+
- Phase D driver-layer hardening:
16+
- Shared cross-driver test harness `RunDriverSuite` under `internal/driver/_testing/`, giving every driver four contract tests for free (connect/inspect, backup→restore round-trip, cancel propagation, bad-credentials sentinel). The Postgres integration test now runs on it.
17+
- Capability gating helper: `app.RequireCapability` resolves a profile to its driver and rejects unsupported affordances with a `CodeUser` error. The helper and the `Capabilities` flags are in place; verbs are wired to it only where the gated feature is implemented. Streaming (`NativeStream`) and parallel backup (`Parallel`) are deferred to Phase F, so `sync --stream` / `backup --jobs` are not yet gated — the wiring lands with those features.
18+
- Connection-probe retry on Postgres `Connect` (3 attempts, exponential backoff) per spec §4.3; the generic `Retry` helper moved to `internal/jobs` to keep the driver layer free of an app-layer import.
19+
- `docs/DRIVERS.md` contributor guide documenting the driver contract, registration, the test harness, capability flags, and error mapping.

README.md

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ A single binary that turns the painful, error-prone sprawl of `pg_dump` → `pg_
1717
---
1818

1919
> [!WARNING]
20-
> **Pre-1.0 — active development.** Postgres backup/restore/sync/verify/inspect work end-to-end today (Phase B), and bare `siphon` opens an interactive multi-panel dashboard (Phase C). MySQL/MariaDB, incremental backups, and ops features are on the [roadmap](#roadmap). APIs, flags, and the on-disk dump format may change before 1.0. Track progress via the milestone tags (`phase-a`, `phase-b`, `phase-c`, …).
20+
> **Pre-1.0 — active development.** Postgres backup/restore/sync/verify/inspect work end-to-end today (Phase B), and bare `siphon` opens an interactive multi-panel dashboard (Phase C). The driver layer is hardened with a shared cross-driver test harness, capability gating, and connection retry (Phase D), so MySQL/MariaDB can land mechanically next. MySQL/MariaDB, incremental backups, and ops features are on the [roadmap](#roadmap). APIs, flags, and the on-disk dump format may change before 1.0. Track progress via the milestone tags (`phase-a`, `phase-b`, `phase-c`, `phase-d`, …).
2121
2222
## Table of contents
2323

@@ -47,16 +47,16 @@ A single binary that turns the painful, error-prone sprawl of `pg_dump` → `pg_
4747

4848
## Project status
4949

50-
| Phase | What it delivers | Status |
51-
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
52-
| **A** — Skeleton | Go module, Cobra CLI, TUI placeholder, `Driver` interface + registry, `errs`/`config`/`secrets`/`profile` packages, golangci-lint + depguard, cross-platform CI | ✅ Complete |
53-
| **B** — Postgres walking skeleton | `backup`, `restore`, `sync`, `verify`, `inspect`, `dumps`, `config`, `profile` working end-to-end against PostgreSQL | ✅ Complete |
54-
| **C** — TUI dashboard | Multi-panel Bubble Tea dashboard (profiles · dumps · jobs) with live job progress, backup/restore modal forms, and snapshot tests | ✅ Complete |
55-
| **D** — Driver hardening | Shared cross-driver test harness, capability gating, retry policy | ⏳ Planned |
56-
| **E** — MySQL + MariaDB | Both drivers via a shared `_mysqlcommon` package | ⏳ Planned |
57-
| **F** — Advanced transfer | Incremental backups, bounded-buffer streaming, cross-engine sync, CDC | ⏳ Planned |
58-
| **G** — Ops features | Cloud storage, secret backends, profile groups + 2FA, team mode, audit log, retention, telemetry | ⏳ Planned |
59-
| **H** — Distribution | GoReleaser, Homebrew tap, Scoop bucket, install script, docs site | ⏳ Planned |
50+
| Phase | What it delivers | Status |
51+
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
52+
| **A** — Skeleton | Go module, Cobra CLI, TUI placeholder, `Driver` interface + registry, `errs`/`config`/`secrets`/`profile` packages, golangci-lint + depguard, cross-platform CI | ✅ Complete |
53+
| **B** — Postgres walking skeleton | `backup`, `restore`, `sync`, `verify`, `inspect`, `dumps`, `config`, `profile` working end-to-end against PostgreSQL | ✅ Complete |
54+
| **C** — TUI dashboard | Multi-panel Bubble Tea dashboard (profiles · dumps · jobs) with live job progress, backup/restore modal forms, and snapshot tests | ✅ Complete |
55+
| **D** — Driver hardening | Shared cross-driver test harness (`RunDriverSuite`), capability-gating helper (`RequireCapability`), Postgres connection-probe retry, and a `docs/DRIVERS.md` contributor guide | ✅ Complete |
56+
| **E** — MySQL + MariaDB | Both drivers via a shared `_mysqlcommon` package | ⏳ Planned |
57+
| **F** — Advanced transfer | Incremental backups, bounded-buffer streaming, cross-engine sync, CDC | ⏳ Planned |
58+
| **G** — Ops features | Cloud storage, secret backends, profile groups + 2FA, team mode, audit log, retention, telemetry | ⏳ Planned |
59+
| **H** — Distribution | GoReleaser, Homebrew tap, Scoop bucket, install script, docs site | ⏳ Planned |
6060

6161
## Requirements
6262

@@ -121,19 +121,19 @@ Exit codes follow a POSIX-friendly taxonomy (`0` ok, `1` user error, `2` system
121121

122122
## Commands
123123

124-
| Command | Description |
125-
| ------------------------------------ | -------------------------------------------------------------- |
126-
| `siphon backup [profile]` | Dump a database to a checksummed file in the catalog |
127-
| `siphon restore [dump-id]` | Load a dump into a database (`--clean` to drop-and-recreate) |
128-
| `siphon sync [from] [to]` | Backup + restore in one streamed pass |
129-
| `siphon verify <dump-id>` | Re-hash a dump and check it against its recorded checksum |
130-
| `siphon inspect <profile>` | Show tables, row estimates, and sizes for a profile |
131-
| `siphon dumps list\|inspect\|prune` | List, inspect, or prune saved dumps |
132-
| `siphon profile add\|list\|show\|rm` | Manage named connection profiles |
133-
| `siphon config path\|edit` | Show or edit the config file |
134-
| `siphon schedule` | Cron-managed recurring backups _(Phase G)_ |
135-
| `siphon tunnel` | SSH tunnel helper _(Phase G)_ |
136-
| `siphon` _(bare)_ | Launch the interactive multi-panel dashboard |
124+
| Command | Description |
125+
| ------------------------------------ | ------------------------------------------------------------ |
126+
| `siphon backup [profile]` | Dump a database to a checksummed file in the catalog |
127+
| `siphon restore [dump-id]` | Load a dump into a database (`--clean` to drop-and-recreate) |
128+
| `siphon sync [from] [to]` | Backup + restore in one streamed pass |
129+
| `siphon verify <dump-id>` | Re-hash a dump and check it against its recorded checksum |
130+
| `siphon inspect <profile>` | Show tables, row estimates, and sizes for a profile |
131+
| `siphon dumps list\|inspect\|prune` | List, inspect, or prune saved dumps |
132+
| `siphon profile add\|list\|show\|rm` | Manage named connection profiles |
133+
| `siphon config path\|edit` | Show or edit the config file |
134+
| `siphon schedule` | Cron-managed recurring backups _(Phase G)_ |
135+
| `siphon tunnel` | SSH tunnel helper _(Phase G)_ |
136+
| `siphon` _(bare)_ | Launch the interactive multi-panel dashboard |
137137

138138
Run `siphon <command> --help` for full flags.
139139

@@ -217,6 +217,8 @@ Distribution (Homebrew, Scoop, install script, signed release binaries) lands in
217217

218218
Contributions are welcome. Please read [CONTRIBUTING.md](CONTRIBUTING.md), keep changes within the layered architecture (depguard will tell you if you stray), and make sure `make test` and `make lint` pass before opening a PR.
219219

220+
Adding a new database engine? See [docs/DRIVERS.md](docs/DRIVERS.md) for the driver contributor guide.
221+
220222
## License
221223

222224
[MIT](LICENSE) © [Nikhil Rajput](https://github.com/nixrajput)

0 commit comments

Comments
 (0)