This commit is contained in:
2025-06-12 10:20:26 +08:00
parent 96d537c044
commit b71e718308
40 changed files with 1961 additions and 108 deletions

View File

@@ -25,10 +25,10 @@ type PostgreSQLOptions struct {
// DSN return DSN from PostgreSQLOptions.
func (o *PostgreSQLOptions) DSN() string {
splited := strings.Split(o.Addr, ":")
host, port := splited[0], "5432"
if len(splited) > 1 {
port = splited[1]
split := strings.Split(o.Addr, ":")
host, port := split[0], "5432"
if len(split) > 1 {
port = split[1]
}
return fmt.Sprintf(`user=%s password=%s host=%s port=%s dbname=%s sslmode=disable TimeZone=Asia/Shanghai`,