Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
47b74885
Commit
47b74885
authored
Mar 17, 2026
by
clover614
Browse files
fix(auto setup): 修复初始测试连接硬编码问题导致使用自定义数据库测试失败无法执行 auto setup流程
parent
f42c8f2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
backend/internal/setup/setup.go
View file @
47b74885
...
...
@@ -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=
postgre
s 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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment