Skip to main content
SqlVFS keeps a filesystem in a database’s tables: a SQLite file, a Postgres server, a Durable Object’s storage or a D1 database.

Install

Config

To mount Postgres, install pg and pass its driver:
The tables are laid out as AgentFS’s:
  • fs_inode: one row per file and directory, with its size and mtime
  • fs_dentry: each entry’s name under its parent directory
  • fs_data: a file’s bytes, in rows of the database’s chunk size (4 KiB unless the database says otherwise)
  • fs_config: the chunk size
One database holds one filesystem. The Python mount reads and writes the same tables, so the two runtimes on one file serve one filesystem.

VFS.md

The VFS.md an agent reads with SQL mounted at /<path>.

Virtual Filesystem

Supported Unix Commands for VFS

Unix commands work on each path as on a local filesystem, as far as the path supports them:

Limitations of Unix Commands for VFS

Where a path differs from a local filesystem:Run man <cmd> or <cmd> --help for one command’s usage.