refactor: use only one DB instance for the whole application

This commit is contained in:
Deluan
2020-02-28 14:16:15 -05:00
parent 38faffa907
commit faa2a978c0
4 changed files with 61 additions and 56 deletions
+2 -2
View File
@@ -21,8 +21,8 @@ func TestPersistence(t *testing.T) {
//os.Remove("./test-123.db")
//conf.Server.Path = "./test-123.db"
conf.Server.DbPath = ":memory:"
db.Init()
conf.Server.DbPath = "file::memory:?cache=shared"
orm.RegisterDataBase("default", db.Driver, conf.Server.DbPath)
New()
db.EnsureLatestVersion()
log.SetLevel(log.LevelCritical)