SQLite‑WASM:
The Trick Behind Zero Servers
Same engine. Same file calls. One swapped layer — watch what stays fixed and what flips.
ALWAYS TRUE — NOT A REWRITE, THE REAL THING
Unmodified SQLite C source, compiled by
Emscripten
into
WASM
SQLite Engine
→ boots this app's Viewer & every ERP page
open() · read() · write()
the exact same calls SQLite has always made
VFS
SQLite's own swappable
storage layer
built into SQLite since 2004 —
this isn't a WASM hack
NORMAL COMPUTER
THIS BROWSER TAB
A Real Disk
an OS + file system + physical drive
MEMFS
just bytes in this tab's RAM
e.g. this app's
building_extracted.db
and
erp/ad_seed.db
both get swapped in this way
ALSO AVAILABLE
OPFS
real persistent storage —
detected, not wired in yet
SO THESE DISAPPEAR:
app server
·
DB server
·
network round‑trip