Skip to content

Commit

Permalink
Merge pull request #10 from AAStarCommunity/chao/support-in-memory-db…
Browse files Browse the repository at this point in the history
…-for-local-debug

support in-memory for local debug and quick start
  • Loading branch information
fanhousanbu authored May 2, 2024
2 parents 294f3a5 + 551598a commit 6483956
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion conf/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var onceDb sync.Once
// GetDbClient 获取数据库连接对象
func GetDbClient() *gorm.DB {
onceDb.Do(func() {
if os.Getenv("UnitTestEnv") == "1" {
if os.Getenv("UnitTestEnv") == "1" || os.Getenv("LocalDebug") == "true" {
db, _ = getInMemoryDbClient()
db = db.Debug()
} else {
Expand Down

0 comments on commit 6483956

Please sign in to comment.