Skip to content

Commit ce2cf99

Browse files
committed
feat: parse default port from database type
1 parent 4ac531c commit ce2cf99

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ func main() {
4444
}
4545

4646
port := 0
47+
switch parsedUrl.Scheme {
48+
case "postgres":
49+
port = 5432
50+
case "mysql":
51+
port = 3306
52+
}
4753
rawPort := parsedUrl.Port()
4854
if rawPort != "" {
4955
port, err = strconv.Atoi(rawPort)

0 commit comments

Comments
 (0)