https://www.sqlite.org/src/doc/trunk/src/test_onefile.c
https://www.sqlite.org/vfs.html
IIRC, during one of his talks D. Richard Hipp mentions this actually being done for real.
Reply on news.ycombinator.com