ソースを参照

better sqlite defaults

George Baugh 3 ヶ月 前
親
コミット
36a13e9e29
1 ファイル変更、6 行追加、0 行削除
  1. 6 0
      lib/Trog/SQLite.pm

+ 6 - 0
lib/Trog/SQLite.pm

@@ -66,6 +66,12 @@ sub dbh {
     # Turn on WALmode
     $db->do("PRAGMA journal_mode = WAL") or die "Could not enable WAL mode";
 
+    # Turn on normal sync mode
+    $db->do("PRAGMA synchronous = NORMAL") or die "Could not enable sync mode normal";
+
+    # 5s busy timeout
+    $db->do("PRAGMA busy_timeout = 5000") or die "Could not set busy_timeout";
+
     return $db;
 }