Skip to main content

Module vfs

Module vfs 

Source
Expand description

The OS abstraction layer: graphitesql’s only I/O boundary.

Everything the engine does to durable storage goes through the Vfs and File traits, exactly as SQLite routes all I/O through its sqlite3_vfs. This is what lets the same engine run against in-memory storage, real files, or a host-provided WebAssembly backend without changing a line above this layer.

Two implementations ship in the crate:

  • memory::MemoryVfsVec<u8>-backed, always available (incl. no_std and wasm). Backs :memory: and is the default for tests.
  • std_file::StdVfs — real files via std::fs (feature std).

Positioned reads/writes (*_at) are used throughout rather than a stateful cursor, mirroring pread/pwrite; this keeps the pager’s intent explicit and avoids a shared seek offset.

Modules§

memory
An in-memory Vfs backed by Vec<u8> buffers.
std_filestd
A Vfs backed by real files via std::fs (feature std).

Structs§

OpenFlags
How a database file should be opened.

Enums§

LockLevel
File lock levels, matching SQLite’s locking model.

Traits§

File
An open file: positioned reads/writes plus durability and locking.
Vfs
A virtual file system: opens, deletes, and probes files by name.