Parent: #11
Problem
wt currently requires baseDatabaseName, a root .env containing
DATABASE_URL, and working Postgres administration for new, fresh setup,
remove, prune, and doctor. Port allocation, env seeding/patching, Git
worktree creation, and optional Docker services do not inherently require a
managed local database, so this blocks cloud-hosted, non-Postgres, and
ports/env-only users.
Desired outcome
Make database provisioning an optional, persistent repository capability while
preserving the current local-Postgres behavior for existing configurations.
The exact configuration shape should be selected during design, but it must
distinguish:
- managed Postgres template cloning (today's behavior and backward-compatible
default), and
- no managed database lifecycle.
Logical per-slot database naming must be decoupled from physical provisioning.
In no-managed-database mode, a project may still opt into a derived name such
as app_wt3 for the existing database env patch and {{dbName}} templates,
without wt connecting to or creating that database.
Acceptance criteria
- Existing
wt.config.json files and version-1 registry entries retain their
current behavior without migration work by users.
- A repository can configure
wt new and fresh wt setup to run without
DATABASE_URL, the pg admin client, or any create/existence check.
remove, prune, and doctor skip managed-database operations and
diagnostics for allocations created without a managed database.
- Registry state and human/JSON output represent whether a database is
managed, logically named only, or absent; teardown relies on persisted
allocation state rather than the current config alone.
- The existing
database env patch can rewrite a pre-provisioned/cloud
connection string when a logical per-slot name is configured.
- Docker/env templates have defined behavior when no
dbName exists and
produce a clear validation error if configuration references an unavailable
value.
- Rollback never attempts to drop an externally managed or logically named-only
database.
- Tests cover
new, setup, rollback, remove, prune, doctor, config
compatibility, registry compatibility, env patching, and output in both
managed and unmanaged modes.
Out of scope
Parent: #11
Problem
wtcurrently requiresbaseDatabaseName, a root.envcontainingDATABASE_URL, and working Postgres administration fornew, freshsetup,remove,prune, anddoctor. Port allocation, env seeding/patching, Gitworktree creation, and optional Docker services do not inherently require a
managed local database, so this blocks cloud-hosted, non-Postgres, and
ports/env-only users.
Desired outcome
Make database provisioning an optional, persistent repository capability while
preserving the current local-Postgres behavior for existing configurations.
The exact configuration shape should be selected during design, but it must
distinguish:
default), and
Logical per-slot database naming must be decoupled from physical provisioning.
In no-managed-database mode, a project may still opt into a derived name such
as
app_wt3for the existingdatabaseenv patch and{{dbName}}templates,without
wtconnecting to or creating that database.Acceptance criteria
wt.config.jsonfiles and version-1 registry entries retain theircurrent behavior without migration work by users.
wt newand freshwt setupto run withoutDATABASE_URL, thepgadmin client, or any create/existence check.remove,prune, anddoctorskip managed-database operations anddiagnostics for allocations created without a managed database.
managed, logically named only, or absent; teardown relies on persisted
allocation state rather than the current config alone.
databaseenv patch can rewrite a pre-provisioned/cloudconnection string when a logical per-slot name is configured.
dbNameexists andproduce a clear validation error if configuration references an unavailable
value.
database.
new,setup, rollback,remove,prune,doctor, configcompatibility, registry compatibility, env patching, and output in both
managed and unmanaged modes.
Out of scope
PlanetScale, or similar services.