Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aliases for DB software #413

Merged
merged 5 commits into from
May 17, 2024
Merged

Aliases for DB software #413

merged 5 commits into from
May 17, 2024

Conversation

uzaxirr
Copy link
Member

@uzaxirr uzaxirr commented Apr 30, 2024

Fixes: #395
Screenshot 2024-04-30 at 6 29 49 AM

@uzaxirr uzaxirr self-assigned this Apr 30, 2024
if softwareVersion == "" && software == "MySQL" {
softwareVersion = "8.0"
validSoftwares := map[string][]string{
"mysql": {"mysql", "my", "sql"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should allow "my" and "sql"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

os.Exit(1)
}

if !softwareVersionIsValid {
utility.Error("The provided software version is not valid")
if softwareVersion == "" {
utility.Error(fmt.Sprintf("No version specified for %s. Please provide a version using --version flag. For example, civo database create db-psql --software psql --version 14.", canonicalSoftwareName))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the .

}
}

if !softwareIsValid {
utility.Error("The provided software name is not valid. Make sure you use correct capitalization (e.g. MySQL, PostgreSQL)")
utility.Error("The provided software name is not valid. Make sure you use correct capitalization (e.g., MySQL, PostgreSQL)")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove comma

Copy link
Contributor

@fernando-villalba fernando-villalba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change error message so it doesn't mislead the user to think capitalization is still needed.

}
}

if !softwareIsValid {
utility.Error("The provided software name is not valid. Make sure you use correct capitalization (e.g. MySQL, PostgreSQL)")
utility.Error("The provided software name is not valid. Make sure you use correct capitalization (eg: MySQL, PostgreSQL)")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am confused, if the change was to allow the usage of lowercase names of the database (ideally case insensitive) why do we still have this error asking for correct capitalization?

Copy link
Contributor

@fernando-villalba fernando-villalba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@uzaxirr uzaxirr merged commit be71cc8 into master May 17, 2024
1 check passed
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.

Database software type value input should be more flexible
4 participants