From 771eac64e027513711d2e5b4425080802d23ad54 Mon Sep 17 00:00:00 2001 From: Russ Johnson Date: Wed, 28 Jan 2026 16:06:09 +0100 Subject: [PATCH 1/2] updated readme with new region behavior --- README.md | 61 +++++++++++++++++++++---------------------------------- 1 file changed, 23 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 7a1173f..84be297 100644 --- a/README.md +++ b/README.md @@ -230,6 +230,10 @@ EXAMPLES # Database Commands +## A Note on Regions + +> Note: All workspace databases have to be provisioned in a specific region, and all database commands must be executed in that same region. That region is normally set in the `app.config.yaml` application manifest. Neither the `AIO_DB_REGION` environment variable nor the `--region=` flag override the region value set in the application manifest. See [Getting Started with Database Storage](https://developer.adobe.com/app-builder/docs/guides/app_builder_guides/storage/database) for more details. + ## Collection Management > Note: The commands under `aio app db collection ` are also available as `aio app db col ` shorthand aliases. @@ -247,8 +251,7 @@ FLAGS GLOBAL FLAGS --json Format output as json. - --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. - + --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. DESCRIPTION Get the list of collections in your App Builder database @@ -283,8 +286,7 @@ FLAGS GLOBAL FLAGS --json Format output as json. - --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. - + --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. DESCRIPTION Create a new collection in the database @@ -315,8 +317,7 @@ ARGUMENTS GLOBAL FLAGS --json Format output as json. - --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. - + --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. DESCRIPTION Drop a collection from the database @@ -346,8 +347,7 @@ ARGUMENTS GLOBAL FLAGS --json Format output as json. - --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. - + --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. DESCRIPTION Rename a collection in the database @@ -376,8 +376,7 @@ ARGUMENTS GLOBAL FLAGS --json Format output as json. - --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. - + --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. DESCRIPTION Get statistics for a collection in the database @@ -414,8 +413,7 @@ FLAGS GLOBAL FLAGS --json Format output as json. - --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. - + --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. DESCRIPTION Insert one or more documents into a collection @@ -447,8 +445,7 @@ ARGUMENTS GLOBAL FLAGS --json Format output as json. - --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. - + --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. DESCRIPTION Delete a single document from a collection @@ -484,8 +481,7 @@ FLAGS GLOBAL FLAGS --json Format output as json. - --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. - + --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. DESCRIPTION Find documents in a collection based on filter criteria. @@ -522,8 +518,7 @@ FLAGS GLOBAL FLAGS --json Format output as json. - --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. - + --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. DESCRIPTION Update document(s) in a collection @@ -559,8 +554,7 @@ FLAGS GLOBAL FLAGS --json Format output as json. - --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. - + --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. DESCRIPTION Replace a single document in a collection @@ -592,8 +586,7 @@ ARGUMENTS GLOBAL FLAGS --json Format output as json. - --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. - + --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. DESCRIPTION Count documents in a collection @@ -637,8 +630,7 @@ REQUIRES AT LEAST ONE OF THE INDEX DEFINITION FLAGS GLOBAL FLAGS --json Format output as json. - --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. - + --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. DESCRIPTION Create a new index on a collection in the database @@ -676,8 +668,7 @@ ARGUMENTS GLOBAL FLAGS --json Format output as json. - --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. - + --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. DESCRIPTION Drop an index from a collection in the database @@ -706,8 +697,7 @@ ARGUMENTS GLOBAL FLAGS --json Format output as json. - --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. - + --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. DESCRIPTION Get the list of indexes from a collection in the database @@ -735,8 +725,7 @@ USAGE GLOBAL FLAGS --json Format output as json. - --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. - + --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. DESCRIPTION Test connectivity to your App Builder database @@ -760,8 +749,7 @@ FLAGS GLOBAL FLAGS --json Format output as json. - --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. - + --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. DESCRIPTION Provision a new database for your App Builder application @@ -789,8 +777,7 @@ FLAGS GLOBAL FLAGS --json Format output as json. - --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. - + --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. DESCRIPTION Delete the database for your App Builder application (non-production only) @@ -816,8 +803,7 @@ FLAGS GLOBAL FLAGS --json Format output as json. - --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. - + --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. DESCRIPTION Check the provisioning status of your App Builder database @@ -840,8 +826,7 @@ USAGE GLOBAL FLAGS --json Format output as json. - --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. - + --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. DESCRIPTION Get statistics about your App Builder database From 15c0ca0974f4e5df264948d8a89e30e62f7f60ee Mon Sep 17 00:00:00 2001 From: Russ Johnson Date: Mon, 2 Feb 2026 16:04:58 +0100 Subject: [PATCH 2/2] corrected region documentation, again --- README.md | 60 +++++++++++++++++++++++++++++--------------- src/DBBaseCommand.js | 2 +- 2 files changed, 41 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 84be297..f91263c 100644 --- a/README.md +++ b/README.md @@ -232,7 +232,7 @@ EXAMPLES ## A Note on Regions -> Note: All workspace databases have to be provisioned in a specific region, and all database commands must be executed in that same region. That region is normally set in the `app.config.yaml` application manifest. Neither the `AIO_DB_REGION` environment variable nor the `--region=` flag override the region value set in the application manifest. See [Getting Started with Database Storage](https://developer.adobe.com/app-builder/docs/guides/app_builder_guides/storage/database) for more details. +> Note: All workspace databases have to be provisioned in a specific region, and all database commands must be executed in that same region. If set in the `app.config.yaml` application manifest, that region will be used. If not, it will first fall back to what is set in the --region flag, followed by the AIO_DB_REGION environment variable, and finally to the default `amer` region. See [Getting Started with Database Storage](https://developer.adobe.com/app-builder/docs/guides/app_builder_guides/storage/database) for more details. ## Collection Management @@ -251,7 +251,9 @@ FLAGS GLOBAL FLAGS --json Format output as json. - --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. + --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set. + Any database region set in 'app.config.yaml' takes precedence over all of these. + DESCRIPTION Get the list of collections in your App Builder database @@ -286,7 +288,8 @@ FLAGS GLOBAL FLAGS --json Format output as json. - --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. + --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set. + Any database region set in 'app.config.yaml' takes precedence over all of these. DESCRIPTION Create a new collection in the database @@ -317,7 +320,8 @@ ARGUMENTS GLOBAL FLAGS --json Format output as json. - --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. + --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set. + Any database region set in 'app.config.yaml' takes precedence over all of these. DESCRIPTION Drop a collection from the database @@ -347,7 +351,8 @@ ARGUMENTS GLOBAL FLAGS --json Format output as json. - --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. + --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set. + Any database region set in 'app.config.yaml' takes precedence over all of these. DESCRIPTION Rename a collection in the database @@ -376,7 +381,8 @@ ARGUMENTS GLOBAL FLAGS --json Format output as json. - --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. + --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set. + Any database region set in 'app.config.yaml' takes precedence over all of these. DESCRIPTION Get statistics for a collection in the database @@ -413,7 +419,8 @@ FLAGS GLOBAL FLAGS --json Format output as json. - --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. + --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set. + Any database region set in 'app.config.yaml' takes precedence over all of these. DESCRIPTION Insert one or more documents into a collection @@ -445,7 +452,8 @@ ARGUMENTS GLOBAL FLAGS --json Format output as json. - --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. + --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set. + Any database region set in 'app.config.yaml' takes precedence over all of these. DESCRIPTION Delete a single document from a collection @@ -481,7 +489,8 @@ FLAGS GLOBAL FLAGS --json Format output as json. - --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. + --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set. + Any database region set in 'app.config.yaml' takes precedence over all of these. DESCRIPTION Find documents in a collection based on filter criteria. @@ -518,7 +527,8 @@ FLAGS GLOBAL FLAGS --json Format output as json. - --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. + --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set. + Any database region set in 'app.config.yaml' takes precedence over all of these. DESCRIPTION Update document(s) in a collection @@ -554,7 +564,8 @@ FLAGS GLOBAL FLAGS --json Format output as json. - --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. + --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set. + Any database region set in 'app.config.yaml' takes precedence over all of these. DESCRIPTION Replace a single document in a collection @@ -586,7 +597,8 @@ ARGUMENTS GLOBAL FLAGS --json Format output as json. - --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. + --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set. + Any database region set in 'app.config.yaml' takes precedence over all of these. DESCRIPTION Count documents in a collection @@ -630,7 +642,8 @@ REQUIRES AT LEAST ONE OF THE INDEX DEFINITION FLAGS GLOBAL FLAGS --json Format output as json. - --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. + --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set. + Any database region set in 'app.config.yaml' takes precedence over all of these. DESCRIPTION Create a new index on a collection in the database @@ -668,7 +681,8 @@ ARGUMENTS GLOBAL FLAGS --json Format output as json. - --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. + --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set. + Any database region set in 'app.config.yaml' takes precedence over all of these. DESCRIPTION Drop an index from a collection in the database @@ -697,7 +711,8 @@ ARGUMENTS GLOBAL FLAGS --json Format output as json. - --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. + --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set. + Any database region set in 'app.config.yaml' takes precedence over all of these. DESCRIPTION Get the list of indexes from a collection in the database @@ -725,7 +740,8 @@ USAGE GLOBAL FLAGS --json Format output as json. - --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. + --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set. + Any database region set in 'app.config.yaml' takes precedence over all of these. DESCRIPTION Test connectivity to your App Builder database @@ -749,7 +765,8 @@ FLAGS GLOBAL FLAGS --json Format output as json. - --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. + --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set. + Any database region set in 'app.config.yaml' takes precedence over all of these. DESCRIPTION Provision a new database for your App Builder application @@ -777,7 +794,8 @@ FLAGS GLOBAL FLAGS --json Format output as json. - --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. + --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set. + Any database region set in 'app.config.yaml' takes precedence over all of these. DESCRIPTION Delete the database for your App Builder application (non-production only) @@ -803,7 +821,8 @@ FLAGS GLOBAL FLAGS --json Format output as json. - --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. + --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set. + Any database region set in 'app.config.yaml' takes precedence over all of these. DESCRIPTION Check the provisioning status of your App Builder database @@ -826,7 +845,8 @@ USAGE GLOBAL FLAGS --json Format output as json. - --region= Database region. Has no effect if region is set in the app.config.yaml application manifest. + --region= Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set. + Any database region set in 'app.config.yaml' takes precedence over all of these. DESCRIPTION Get statistics about your App Builder database diff --git a/src/DBBaseCommand.js b/src/DBBaseCommand.js index e9381ec..97d921c 100644 --- a/src/DBBaseCommand.js +++ b/src/DBBaseCommand.js @@ -104,7 +104,7 @@ DBBaseCommand.flags = { helpGroup: 'GLOBAL' }, region: Flags.string({ - description: `Database region. Defaults to 'AIO_DB_REGION' environment variable or '${DEFAULT_REGION}' if neither is set.\n`, + description: `Database region. Defaults to 'AIO_DB_REGION' environment variable or '${DEFAULT_REGION}' if neither is set. Any database region set in 'app.config.yaml' takes precedence over all of these.\n`, required: false, helpGroup: 'GLOBAL' // Don't set default here to let it load from the environment var if not passed as a flag