Skip to content

Commit e559484

Browse files
Add --detach flag to Postgres remove DB command
1 parent d24c1a0 commit e559484

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/commands/postgres/databases/remove.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ export default class PostgresDatabasesRemove extends Command {
1111
disco: Flags.string({required: false}),
1212
instance: Flags.string({required: true}),
1313
database: Flags.string({required: true}),
14+
detach: Flags.boolean({default: false, description: 'detach from any project the database was attached to'}),
1415
}
1516

1617
public async run(): Promise<void> {
1718
const {flags} = await this.parse(PostgresDatabasesRemove)
1819
const discoConfig = getDisco(flags.disco || null)
19-
const url = `https://${discoConfig.host}/api/projects/postgres-addon/cgi/endpoints/instances/${flags.instance}/databases/${flags.database}`
20+
const url = `https://${discoConfig.host}/api/projects/postgres-addon/cgi/endpoints/instances/${flags.instance}/databases/${flags.database}?detach=${flags.detach ? 'true' : 'false'}`
2021
await request({
2122
method: 'DELETE',
2223
url,

0 commit comments

Comments
 (0)