diff --git a/internal/storage/database.go b/internal/storage/database.go index a9fc539..6ae1276 100644 --- a/internal/storage/database.go +++ b/internal/storage/database.go @@ -76,6 +76,12 @@ func InitDB() error { // @see https://github.com/mattn/go-sqlite3#faq db.SetMaxOpenConns(1) + // SQLite performance tuning (https://phiresky.github.io/blog/2020/sqlite-performance-tuning/) + _, err = db.Exec("PRAGMA journal_mode = WAL; PRAGMA synchronous = normal;") + if err != nil { + return err + } + // create tables if necessary & apply migrations if err := dbApplyMigrations(); err != nil { return err