Add --external-database flag for externally-managed databases - #173
Open
blsmth wants to merge 1 commit into
Open
Add --external-database flag for externally-managed databases#173blsmth wants to merge 1 commit into
blsmth wants to merge 1 commit into
Conversation
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.
Member
|
I think we can do this without any confirmation changes by inspecting
`DATABASE_URL` if a database isn’t connected.
…On Tuesday, August 11, 2026, Brendan Smith ***@***.***> wrote:
Closes #146 <#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?
------------------------------
You can view, comment on, or merge this pull request online at:
#173
Commit Summary
- 85333e4
<85333e4>
Add --external-database flag for externally-managed databases
File Changes
(5 files <https://github.com/apppackio/apppack/pull/173/files>)
- *M* app/app.go
<https://github.com/apppackio/apppack/pull/173/files#diff-0f1d2976054440336a576d47a44a37b80cdf6701dd9113012bce0e3c425819b7>
(53)
- *A* app/db_test.go
<https://github.com/apppackio/apppack/pull/173/files#diff-0b83ab9ace3cef740a068338080411c0dbf6939f6312fa859e21eecdba4ba7cf>
(55)
- *M* cmd/create.go
<https://github.com/apppackio/apppack/pull/173/files#diff-e52f1f4fa0c533e3287cbe2ef0436582b5ca471a3fddcdf1f49fecd1ec0c7d13>
(1)
- *M* stacks/app_pipeline.go
<https://github.com/apppackio/apppack/pull/173/files#diff-4d723cfd1f5868b91d58c87c8889fe5876308ca123e662b4dfd1d92b886539a6>
(162)
- *M* stacks/app_pipeline_test.go
<https://github.com/apppackio/apppack/pull/173/files#diff-8896a004e806c4fd2a86ad540f059d01b03bbfc77d6d4b8e78488a5751db8f8e>
(124)
Patch Links:
- https://github.com/apppackio/apppack/pull/173.patch
- https://github.com/apppackio/apppack/pull/173.diff
—
Reply to this email directly, view it on GitHub
<#173?email_source=notifications&email_token=AACN5NAMWYT6CG26WRO62UD5JN737A5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DENJWG43TANJTGGTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVRTG633UMVZF6Y3MNFRWW>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACN5NFYIIMRRSSFGCMONXD5JN737AVCNFSNUABFKJSXA33TNF2G64TZHMZTCOJXGM2TENBVHNEXG43VMU5TKMJSGQZTQNZWHE4KC5QC>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/AACN5NF5N7GLMFI26QSEAPL5JN737A5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DENJWG43TANJTGGTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVJTG633UMVZF62LPOM>
and Android
<https://github.com/notifications/mobile/android/AACN5NBOHZEBM7PTHYPEJIL5JN737A5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DENJWG43TANJTGGTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVZTG633UMVZF6YLOMRZG62LE>.
Download it today!
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #146.
Adds
--external-database <postgres|mysql>toapppack create app, which sets a newExternalDatabaseEngineCloudFormation parameter sodb shell/db dump/db loadcan target an externally-managed database (Neon, Crunchy, etc.) reachable via the app'sDATABASE_URLconfig variable. Also adds a matching interactive prompt inAskForDatabase(forapppack modify app), client-side validation (mutually exclusive with--addon-database/--addon-database-name, engine must bepostgresormysql), and replaces the unhelpful "unknown database engine " error with a targeted message pointing users at eitherapppack modify app/--external-databaseorapppack create database.Depends on the formations change (apppack-backend) landing and being released first — until formations emits
dbutils.enginefor externally-configured apps, setting this flag has no effect.Caveat carried over from the spec:
apppack db load'sload-from-s3.shscript 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 shellanddb dumpare the confident wins here;db loadmay not reach full parity even after this lands.Happy path (
DBShellTaskInfo/DBDumpLocation/DBDumpLoadFamily,isPostgresincmd/db.go) is unchanged.Want a Test Plan section added, or is this concise enough as-is?