Filesystem access

Reading a database document usually requires a client library or a service that translates a tool's request. An editor or shell already knows how to read a file. Requiring database-specific code for that operation limits which tools can participate. The filesystem plugin presents database documents through paths that existing tools understand.

Existing tools as clients

A database opened with the plugin appears as a mounted directory. Listing directories reveals its data and stored definitions, so discovery uses the same interface as reading. The mount appears when the database opens and disappears when it closes. The application that opens the database also owns the mount's lifetime.

A pager can inspect a document, and a script can read the same document without loading a language binding. Definitions and stored objects have paths alongside entity documents. A copied file is still only a projection of the data it contains. Complete recovery remains the responsibility of database backups, which keep transaction history and referenced objects together.

Projections of one set of facts

JSON and DUST provide different views of the same facts. Reading a document renders those facts, and saving either notation uses the same validation and transaction history. There are no separate JSON and DUST copies for the application to synchronize. A tool can choose the notation it understands while another tool uses the other view.

The mount therefore gives file operations database meanings. Saving an entity changes its facts, and saving a definition checks that definition before committing it. A merge patch changes only the fields it names. Transactions and object projections remain read-only, and the read-only mount option refuses every write.

Concurrent edits

An editor may keep a document open while another writer changes the same entity. Saving that old document without a check could erase the newer work. Each document save therefore uses the entity revision that the editor opened. A changed revision causes a conflict, including a change that later restores the same value.

Editors that save through a temporary file also need a revision to compare. Creating that temporary file captures destination revisions in its directory, and renaming it over a document checks the selected destination. The comparison and save happen atomically, while unrelated entity writes remain allowed. Cross-directory replacement through a temporary file is refused because its captured revisions belong to the creation directory.

Deliberate removal can change historical facts without creating an ordinary revision of the affected document. Affected open snapshots and staged saves then expire and require a new open. This prevents a stale editor buffer from restoring information through an old save. Bytes that an application already read remain outside the mount's control.

macOS mounts use FUSE-T, which serves the mount over NFS. NFS cannot invalidate a file that is already open, so the mount could not expire an affected snapshot. On macOS, deliberate removal therefore refuses to run while a mount is configured, and changes nothing. Removal runs after the database reopens without the mount. Linux and WSL2 mounts expire affected snapshots and permit removal while mounted.

File operations with limits

A definition can move or change its name, but an entity document keeps the numeric identity represented by its filename. Deleting an entity document retracts its current data. Deleting a historical transaction would have a different meaning, so the mount refuses that operation. These distinctions let tools change current data without silently rewriting history.

File errors provide less detail than database errors. A failed save can identify a conflict or invalid argument without explaining the field or schema rule involved. The plugin exposes its latest refusal through database status for further inspection. Applications that need a detailed response to each operation can use the typed bindings.

Platform boundary

Linux uses FUSE, and macOS uses FUSE-T, so both need the corresponding operating-system support. Native Windows refuses the mount option, while WSL2 can use the Linux library and mount. The optional plugin ships as a shared library and belongs to the process opening the database. File operations provide document access, while queries and live result streams use the database API.