Skip to content

Add --external-database flag for externally-managed databases - #173

Open
blsmth wants to merge 1 commit into
mainfrom
issue-146-external-database
Open

Add --external-database flag for externally-managed databases#173
blsmth wants to merge 1 commit into
mainfrom
issue-146-external-database

Conversation

@blsmth

@blsmth blsmth commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Closes #146.

Adds --external-database <postgres|mysql> to apppack create app, which sets a new ExternalDatabaseEngine CloudFormation parameter so db shell/db dump/db load can target an externally-managed database (Neon, Crunchy, etc.) reachable via the app's DATABASE_URL config variable. Also adds a matching interactive prompt in AskForDatabase (for apppack modify app), client-side validation (mutually exclusive with --addon-database/--addon-database-name, engine must be postgres or mysql), and replaces the unhelpful "unknown database engine " error with a targeted message pointing users at either apppack modify app/--external-database or apppack create database.

Depends on the formations change (apppack-backend) landing and being released first — until formations emits dbutils.engine for externally-configured apps, setting this flag has no effect.

Caveat carried over from the spec: apppack db load's load-from-s3.sh script likely does a DROP/CREATE of the target database, which some managed providers (e.g. Neon) may not permit for the app's role. db shell and db dump are the confident wins here; db load may not reach full parity even after this lands.

Happy path (DBShellTaskInfo/DBDumpLocation/DBDumpLoadFamily, isPostgres in cmd/db.go) is unchanged.

Want a Test Plan section added, or is this concise enough as-is?

Registers ExternalDatabaseEngine as a CloudFormation parameter on
apppack create app (postgres|mysql), validates it is mutually
exclusive with --addon-database/--addon-database-name, and adds a
matching interactive prompt in AskForDatabase for apppack modify app.

Also replaces the unhelpful "unknown database engine " error (empty
engine) with a targeted message that checks for a DATABASE_URL config
variable and tells the user how to enable db utils or create a
database.
@ipmb

ipmb commented Aug 12, 2026 via email

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow DB commands against external databases

2 participants