This commit is contained in:
ryan
2026-06-07 19:47:24 +08:00
parent 48d414e197
commit 360a26f109
60 changed files with 10063 additions and 637 deletions
+5
View File
@@ -175,3 +175,8 @@ func buildDSN(host string, port int, username, password string) string {
func DB(ctx context.Context) *gorm.DB {
return db.WithContext(ctx)
}
// SetDB sets the package-level database instance for testing.
func SetDB(d *gorm.DB) {
db = d
}