소스 검색

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;
 }