db provider
The db provider projects one SQLite database into a read-only filesystem. It is useful for schema inspection and bounded samples, not arbitrary SQL execution.
Read-only prevents writes, not disclosure. sample.json can expose table data. Mount only databases that are safe for local processes with access to /omnifs/db to inspect.
At a glance
Section titled “At a glance”| Field | Value |
|---|---|
| Provider id | db |
| Default mount | /db |
| WASM | omnifs_provider_db.wasm |
| Manifest | providers/db/omnifs.provider.json |
| Routes | providers/db/src/lib.rs |
| Auth | none |
| Capabilities | read-only WASI preopen for the selected database file’s parent directory; declared memory need 128 MB |
omnifs init dbomnifs upomnifs shellomnifs init db asks for the SQLite file. The selected file’s parent directory is preopened read-only as /data, and the provider opens the configured guest-visible path inside it. No upstream credentials are involved.
Main paths
Section titled “Main paths”/db/meta/db/meta/info.json/db/tables/db/tables/{table}/db/tables/{table}/table.json/db/tables/{table}/schema.sql/db/tables/{table}/schema.json/db/tables/{table}/indexes.json/db/tables/{table}/count.txt/db/tables/{table}/sample.jsonExamples
Section titled “Examples”ls /omnifs/db/tablescat /omnifs/db/meta/info.json | jq .cat /omnifs/db/tables/Album/table.json | jq .cat /omnifs/db/tables/Album/schema.sqlcat /omnifs/db/tables/Album/schema.json | jq .cat /omnifs/db/tables/Album/count.txtcat /omnifs/db/tables/Album/sample.json | jq .Configuration
Section titled “Configuration”| Key | Required | Default | Meaning |
|---|---|---|---|
database_type | yes | sqlite | Database backend. Supported value: sqlite. |
path | yes | /data/test.db | SQLite database path. |
read_only | no | true | Open the database read-only. |
sample_limit | no | 20 | Maximum rows returned in sample.json. |
The mount remains a read projection. Setting read_only is about how SQLite opens the file internally; it does not turn omnifs into a writable database mount.
Cache behavior
Section titled “Cache behavior”/meta and /tables/{table} are object routes with canonical JSON bytes and rendered leaves. sample.json is a separate projection because row samples are bounded reads over table data.
Limitations
Section titled “Limitations”The db provider supports SQLite. It does not execute arbitrary SQL from the mounted filesystem. Table names are limited to tables known when the provider starts.