Skip to content

Commit

Permalink
Add support for aurora postgres and mysql in proxy command
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaWilkes committed Sep 25, 2024
1 parent 18daa6e commit 4763afd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/granted/rds/rds.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,11 @@ var proxyCommand = cli.Command{
var connectionString, cliString, port string
yellow := color.New(color.FgYellow)
switch commandData.GrantOutput.Database.Engine {
case "postgres":
case "postgres", "aurora-postgresql":
port = grab.If(overridePort != 0, strconv.Itoa(overridePort), "5432")
connectionString = yellow.Sprintf("postgresql://%s:[email protected]:%s/%s?sslmode=disable", commandData.GrantOutput.User.Username, port, commandData.GrantOutput.Database.Database)
cliString = yellow.Sprintf(`psql "postgresql://%s:[email protected]:%s/%s?sslmode=disable"`, commandData.GrantOutput.User.Username, port, commandData.GrantOutput.Database.Database)
case "mysql":
case "mysql", "aurora-mysql":
port = grab.If(overridePort != 0, strconv.Itoa(overridePort), "3306")
connectionString = yellow.Sprintf("%s:password@tcp(127.0.0.1:%s)/%s", commandData.GrantOutput.User.Username, port, commandData.GrantOutput.Database.Database)
cliString = yellow.Sprintf(`mysql -u %s -p'password' -h 127.0.0.1 -P %s %s`, commandData.GrantOutput.User.Username, port, commandData.GrantOutput.Database.Database)
Expand Down

0 comments on commit 4763afd

Please sign in to comment.