Repository navigation
feat(database-ng) add support database flag to dbng commands - #1153
Conversation
4b3af30 to
9007193
Compare
|
|
||
| for _, db := range dbs { | ||
| if db.App.Name == resourceName { | ||
| if db.App.Name == resourceName || db.App.ID == resourceName { |
There was a problem hiding this comment.
Here both check are needed because:
- the database ID is used for all
scalingo database*commands. - the database name is used for all others (like what we do with
apps).
9007193 to
8865a70
Compare
cf65a0c to
3a53979
Compare
| "scalingo database-info database_id", | ||
| "scalingo database-info --database database_id", |
There was a problem hiding this comment.
non-blocking: I don't remember if this was in the specs, but when seeing this I wonder if this is a good idea to allow both options.
There was a problem hiding this comment.
As talked during last PSM, we want to use this PR as support for this topic precisely. So your comment is welcome 👍
To answer, IMO we could keep both.
The usage of flags (i.e. --database here) was not in the specs, but they are easier to use and that's currently how we do for other commands.
e.g. equivalent command for apps:
scalingo apps-info --app <app_name>If we had to choose one, I would go with the use of flags (--database). But I'll let @leo-scalingo give his opinion.
There was a problem hiding this comment.
I also prefer using flags than arguments, for this precise command, since the database_id is the subject I'm ok to keep both as syntax sugar
| Examples: []string{ | ||
| "scalingo database-create --type postgresql --plan postgresql-dbng-starter-2048 my_super_database", | ||
| "scalingo database-create --type postgresql --plan postgresql-dbng-starter-2048 --wait my_super_database", | ||
| "scalingo database-create --type postgresql-ng --plan postgresql-ng-enterprise-4096 my_super_database", |
There was a problem hiding this comment.
question: I don't think the type is different, is it?
| "scalingo database-create --type postgresql-ng --plan postgresql-ng-enterprise-4096 my_super_database", | |
| "scalingo database-create --type postgresql --plan postgresql-ng-enterprise-4096 my_super_database", |
There was a problem hiding this comment.
It is since the first deployment of given plans. We now distinguish between the two.
Note: there were a conflict of credentials (cf: STORY-2622)
| "scalingo database-info database_id", | ||
| "scalingo database-info --database database_id", |
There was a problem hiding this comment.
I also prefer using flags than arguments, for this precise command, since the database_id is the subject I'm ok to keep both as syntax sugar
Concerned commands are: - timeline - database-*-feature - backups-config - database-users*
a481deb to
a1cb464
Compare
With --app and a database ID
With the correct --database flag
➜ scalingo database-info --database $DATABASE_ID ┌────────────────────────┬───────────────────────────────┐ │ ID │ 68c43e3cd9985668949c5ffa │ ...With a database name
The generated help
➜ scalingo database-info --help NAME: scalingo database-info - View database next generation USAGE: scalingo database-info database-id CATEGORY: Databases NG DESCRIPTION: View database next generation detailed informations Examples $ scalingo database-info database_id $ scalingo database-info --database database_id # See also 'databases' 'database-create' 'database-destroy' OPTIONS: --database string ID of the current database (default: "<database_name>") --region string Name of the region to use --help, -h show helpAlso fixes STORY-2587