Skip to content

Commit

Permalink
feat: parse default port from database type
Browse files Browse the repository at this point in the history
  • Loading branch information
Nsttt committed Apr 14, 2024
1 parent 4ac531c commit ce2cf99
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ func main() {
}

port := 0
switch parsedUrl.Scheme {
case "postgres":
port = 5432
case "mysql":
port = 3306
}
rawPort := parsedUrl.Port()
if rawPort != "" {
port, err = strconv.Atoi(rawPort)
Expand Down

0 comments on commit ce2cf99

Please sign in to comment.