Skip to content

Commit 60f4191

Browse files
agneumSarumyan
authored andcommitted
feat: Simplified Install for DBLab 4.2 (Simple/Expert modes + autodetection)
1 parent 1ea3058 commit 60f4191

95 files changed

Lines changed: 9766 additions & 238 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CLAUDE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
88
1.1. **Entry Points** (`cmd/`)
99
2. **Frontend code** (`ui/`)
1010

11+
### Notable patterns
12+
- **Source-detection logic** lives in `engine/internal/retrieval/probe/`. The `Propose` orchestrator returns a structured `ProposedConfig` consumed by both the `/admin/probe-source` HTTP handler and the `dblab local-install` CLI (`engine/cmd/cli/commands/localinstall/`). Extend probe rules there, not in `tools/db/pg.go`.
13+
- **Config projection** (`engine/pkg/models/configuration.go` + `engine/pkg/util/projection/`) walks only top-level struct fields with single flat `proj:"..."` paths — no recursion into nested structs. The `RetrievalMode` field on `ConfigProjection` carries no `proj:` tag because it's a synthetic field injected by `projectedAdminConfig` after `StoreJSON`; the request-side dispatcher reads it directly from the incoming JSON map. A projection field for a key that is **not pre-seeded** in the config scaffold (e.g. `connectionString`) needs the `,createKey` tag — `projection.Set` silently skips a missing leaf without it.
14+
- **Mode-aware config writes**: `applyProjectedAdminConfig` dispatches on the synthetic `retrievalMode`, and `guardModeFields` enforces a per-mode allow-list of populated fields so logical-only fields cannot leak into a physical config (and vice-versa).
15+
- **Source connection-string passthrough**: when `logicalDump.options.source.connectionString` is set it wins over the discrete `connection.*` fields. `logical/connstring.go` (`withDatabase`, `sourcePgxConfig`) preserves every libpq option (sslmode, connect_timeout, …) end-to-end into `pg_dump` (`-d <conninfo>`) and the engine's own pgx connections to the **source** (`getDBList`, `dbSourceActivity`). The password is always injected separately — never embedded in the string. Restore paths target the local container and must never receive it.
16+
- **Engine-side image resolution**: `probe/registry.go` resolves a glibc-aware docker image by querying the live registries (Docker Hub for the generic image, GitLab for managed-provider SE images) with a per-repo TTL cache and a `go:embed` offline snapshot (`images_fallback.json`). Resolution never hard-fails or hangs: fresh cache → live fetch (bounded) → last good cache → embedded snapshot → provider default `<repo>:<major>`. Tag selection (`imageselect.go`) is pure and unit-tested; the `Registry` is built once on `Server`.
17+
1118
## Testing Before Pushing
1219

1320
**Always run tests before pushing.** If tests fail, do not push. Fix the failing tests first. Only skip this if the user explicitly says to ignore test failures.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ Read more:
104104
- Location flexibility: self-managed PostgreSQL, AWS RDS, GCP Cloud SQL, Azure, etc.—no source adjustments needed.
105105
- No ZFS or Docker requirements for source databases
106106
- Data provisioning & retrieval
107+
- Simple-mode setup: paste source URL + password, get a probed configuration in one click (UI Configuration → Simple tab)
108+
- Expert-mode form for both logical (dump/restore) and physical (WAL-G, pgBackRest) retrieval
107109
- Physical (pg_basebackup, WAL-G, pgBackRest) and logical (dump/restore) provisioning
108110
- Partial data retrieval in logical mode (specific databases/tables)
109111
- Database renaming during snapshot creation (`databaseRename` option)

docs/plans/20260518-simplified-install-4.2.md

Lines changed: 549 additions & 0 deletions
Large diffs are not rendered by default.

docs/plans/completed/20260619-cli-connstrings-glibc.md

Lines changed: 482 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)