Repo .git was damaged (refs/ missing, index truncated, object store near-empty). Repaired via git init (rebuilt refs), stale index preserved as .git/index.corrupt-20260910.bak, then full worktree committed as a rollback baseline.
28 lines
562 B
Go
28 lines
562 B
Go
package conf
|
|
|
|
import "fmt"
|
|
|
|
func MySQLDsn() string {
|
|
return fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?charset=utf8mb4&parseTime=True&loc=Local",
|
|
Database.User,
|
|
Database.Password,
|
|
Database.Host,
|
|
Database.Port,
|
|
Database.Name,
|
|
)
|
|
}
|
|
|
|
func PostgresDsn() string {
|
|
dsn := fmt.Sprintf("host=%s port=%d user=%s password=%s dbname=%s sslmode=disable TimeZone=Asia/Shanghai",
|
|
Database.Host,
|
|
Database.Port,
|
|
Database.User,
|
|
Database.Password,
|
|
Database.Name,
|
|
)
|
|
if Database.Schema != "" {
|
|
dsn += fmt.Sprintf(" search_path=%s", Database.Schema)
|
|
}
|
|
return dsn
|
|
}
|