Skip to content

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.

FieldValue
Provider iddb
Default mount/db
WASMomnifs_provider_db.wasm
Manifestproviders/db/omnifs.provider.json
Routesproviders/db/src/lib.rs
Authnone
Capabilitiesread-only WASI preopen for the selected database file’s parent directory; declared memory need 128 MB
Terminal window
omnifs init db
omnifs up
omnifs shell

omnifs 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.

/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.json
Terminal window
ls /omnifs/db/tables
cat /omnifs/db/meta/info.json | jq .
cat /omnifs/db/tables/Album/table.json | jq .
cat /omnifs/db/tables/Album/schema.sql
cat /omnifs/db/tables/Album/schema.json | jq .
cat /omnifs/db/tables/Album/count.txt
cat /omnifs/db/tables/Album/sample.json | jq .
KeyRequiredDefaultMeaning
database_typeyessqliteDatabase backend. Supported value: sqlite.
pathyes/data/test.dbSQLite database path.
read_onlynotrueOpen the database read-only.
sample_limitno20Maximum 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.

/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.

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.