(These docs are 🚧 under construction 🚧.)
See also: C structs in JS
It is possible to create custom
VFSes. The OPFS VFS is an example of the
former and the Key-Value VFS is an example
of the latter: it has a pure C implementation and three methods get
This document does not aim to explain how to create a custom VFS, as that's covered extensively in the SQLite project's documentation, but covers the utility code supplied to help glue JS and C together for this purpose.
sqlite3_vfs class inherits from the core C struct type
and extends the hierarchy with...
sqlite3_vfs_register() to register this
sqlite3_vfs instance. This object must have already been
filled out properly. If the first argument is truthy, the VFS is
registered as the default VFS, else it is not.
On success, returns this object. Throws on error.