shm_other.go

 1//go:build !(((linux || darwin || windows || freebsd || openbsd || netbsd || dragonfly || illumos) && (386 || arm || amd64 || arm64 || riscv64 || ppc64le)) || sqlite3_flock || sqlite3_dotlk)
 2
 3package vfs
 4
 5// SupportsSharedMemory is false on platforms that do not support shared memory.
 6// To use [WAL without shared-memory], you need to set [EXCLUSIVE locking mode].
 7//
 8// [WAL without shared-memory]: https://sqlite.org/wal.html#noshm
 9// [EXCLUSIVE locking mode]: https://sqlite.org/pragma.html#pragma_locking_mode
10const SupportsSharedMemory = false
11
12// NewSharedMemory returns a shared-memory WAL-index
13// backed by a file with the given path.
14// It will return nil if shared-memory is not supported,
15// or not appropriate for the given flags.
16// Only [OPEN_MAIN_DB] databases may need a WAL-index.
17// You must ensure all concurrent accesses to a database
18// use shared-memory instances created with the same path.
19func NewSharedMemory(path string, flags OpenFlag) SharedMemory {
20	return nil
21}