fix(db): sslmode prefer not supported in some pg version (?) related: #2540

pull/2596/head 4.1.2
Aaron Liu 2025-06-27 13:54:10 +08:00
parent d382bd8f8d
commit f38f32f9f5
1 changed files with 1 additions and 1 deletions

View File

@ -75,7 +75,7 @@ func NewRawEntClient(l logging.Logger, config conf.ConfigProvider) (*ent.Client,
client, err = sql.Open("sqlite3", util.RelativePath(dbConfig.DBFile))
case conf.PostgresDB:
l.Info("Connect to Postgres database %q.", dbConfig.Host)
client, err = sql.Open("postgres", fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%d sslmode=allow",
client, err = sql.Open("postgres", fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%d sslmode=disable",
dbConfig.Host,
dbConfig.User,
dbConfig.Password,