Expand description
Libraries kept on a NAS or network share.
SQLite’s WAL mode keeps its index in shared memory (the -shm file),
which only works when every connection runs on the machine that owns
the file. Over SMB or NFS the locks behind it are unreliable: scans
stall on “database is locked” and memory-mapped pages can go stale.
A library on a network filesystem therefore uses SQLite’s classic
rollback journal and no memory mapping (see Database::open_for_drive).
Detection is automatic. A marker file in the library’s metadata folder turns network mode on for mounts that look local — FUSE mounts the detector misses, unusual setups — and travels with the library. Treating a local disk as network costs some write speed; treating a share as local costs a stuck library, so doubtful cases count as network.
Structs§
- Network
Drive - Whether a library’s database runs in network mode, and why.
Functions§
- is_
network_ filesystem - True when
pathlives on a network filesystem. - network_
drive - set_
forced - Turn the user’s network-mode override for a library on or off. Takes effect the next time the library opens.