mirror of
https://gitee.com/wanwujie/sub2api
synced 2026-04-02 22:42:14 +08:00
Merge pull request #1077 from Clov614/main
fix(auto setup): 修复初始测试连接硬编码问题导致使用自定义数据库测试失败无法执行 auto setup流程
This commit is contained in:
@@ -164,8 +164,8 @@ func NeedsSetup() bool {
|
||||
func TestDatabaseConnection(cfg *DatabaseConfig) error {
|
||||
// First, connect to the default 'postgres' database to check/create target database
|
||||
defaultDSN := fmt.Sprintf(
|
||||
"host=%s port=%d user=%s password=%s dbname=postgres sslmode=%s",
|
||||
cfg.Host, cfg.Port, cfg.User, cfg.Password, cfg.SSLMode,
|
||||
"host=%s port=%d user=%s password=%s dbname=%s sslmode=%s",
|
||||
cfg.Host, cfg.Port, cfg.User, cfg.Password, cfg.DBName, cfg.SSLMode,
|
||||
)
|
||||
|
||||
db, err := sql.Open("postgres", defaultDSN)
|
||||
|
||||
Reference in New Issue
Block a user