From: Jacob Casper Date: Thu, 16 Apr 2020 23:28:38 +0000 (-0500) Subject: Enable WAL to allow concurrent reads X-Git-Url: https://git.jacobcasper.com/?a=commitdiff_plain;h=61697e616eb2fadcd8b10f070225bfadc2af615a;p=brackets.git Enable WAL to allow concurrent reads This journaling mode means that we won't have to lock for reads and can manage DB locking only around writes. --- diff --git a/db/db.go b/db/db.go index 1697648..3c04e68 100644 --- a/db/db.go +++ b/db/db.go @@ -12,7 +12,7 @@ type DB struct { } func New() (*DB, error) { - db, err := sql.Open("sqlite3", "brackets.sqlite") + db, err := sql.Open("sqlite3", "brackets.sqlite?_journal_mode=WAL&_foreign_keys=on") if err != nil { return nil, err }