File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 11#include " sqlite.hh"
2+ #include " globals.hh"
23#include " util.hh"
34
45#include < sqlite3.h>
@@ -27,8 +28,12 @@ namespace nix {
2728
2829SQLite::SQLite (const Path & path, bool create)
2930{
31+ // useSQLiteWAL also indicates what virtual file system we need. Using
32+ // `unix-dotfile` is needed on NFS file systems and on Windows' Subsystem
33+ // for Linux (WSL) where useSQLiteWAL should be false by default.
34+ const char *vfs = settings.useSQLiteWAL ? 0 : " unix-dotfile" ;
3035 if (sqlite3_open_v2 (path.c_str (), &db,
31- SQLITE_OPEN_READWRITE | (create ? SQLITE_OPEN_CREATE : 0 ), 0 ) != SQLITE_OK)
36+ SQLITE_OPEN_READWRITE | (create ? SQLITE_OPEN_CREATE : 0 ), vfs ) != SQLITE_OK)
3237 throw Error (" cannot open SQLite database '%s'" , path);
3338
3439 if (sqlite3_busy_timeout (db, 60 * 60 * 1000 ) != SQLITE_OK)
You can’t perform that action at this time.
0 commit comments