fix(config): harden database pool settings

This commit is contained in:
2026-05-03 15:04:08 +08:00
parent 774b907da8
commit cec7fa25e3
13 changed files with 105 additions and 43 deletions
@@ -27,6 +27,23 @@ llm:
}
}
func TestDatabaseConfigDSNEscapesCredentials(t *testing.T) {
cfg := DatabaseConfig{
Host: "db.internal",
Port: 5432,
User: "geo",
Password: "p@ss:word/with?symbols",
DBName: "geo",
SSLMode: "disable",
}
got := cfg.DSN()
want := "postgres://geo:p%40ss%3Aword%2Fwith%3Fsymbols@db.internal:5432/geo?sslmode=disable"
if got != want {
t.Fatalf("DSN() = %q, want %q", got, want)
}
}
func TestLoadFallsBackToConfigLLMAPIKey(t *testing.T) {
t.Setenv("LLM_API_KEY", "")