From e966fffc21f4928c00e6557ca8e999e1ca8e1b51 Mon Sep 17 00:00:00 2001 From: sentriz Date: Fri, 24 Apr 2020 20:18:29 +0100 Subject: [PATCH] set journal WAL in connection string, not command --- db/db.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/db.go b/db/db.go index 13b6a65..5af3d00 100644 --- a/db/db.go +++ b/db/db.go @@ -20,6 +20,7 @@ var ( // with this, the db sleeps for a little while when locked. can prevent // a SQLITE_BUSY. see https://www.sqlite.org/c3ref/busy_timeout.html "_busy_timeout": []string{"30000"}, + "_journal_mode": []string{"WAL"}, } ) @@ -35,7 +36,6 @@ func New(path string) (*DB, error) { } db.SetLogger(log.New(os.Stdout, "gorm ", 0)) db.DB().SetMaxOpenConns(dbMaxOpenConns) - db.Exec("PRAGMA journal_mode=WAL;") migr := gormigrate.New(db, gormigrate.DefaultOptions, []*gormigrate.Migration{ &migrationInitSchema, &migrationCreateInitUser,