description: "SQLite storage backend for hosts and maintainers choosing, configuring, or debugging document-per-row KV storage in one database file."
English | 中文
dsh-storage-sqlite is a storage backend that hosts every routed unit in one SQLite database file, storing each record as one JSON document per row, registered as backend sqlite. A single record update touches exactly one row, which is what makes this the right medium for high-frequency, point-sized writes. Choose it when a domain's data changes often or the deployment prefers one queryable database; choose the JSON backend when the data should be readable as plain files. The backend is host-side only: it contributes no prompt, tool, or schema, so the model and the agent loop never see it.
Use this package when a composition keeps frequently updated domain data in one database: route the relevant domains to this backend and each unit materializes as tables in the configured database file.
Choose it when writes are frequent and point-sized — each key maps to exactly one row, so updating one record touches one row instead of rewriting a whole file. Choose the JSON backend when humans inspect or edit the stored data as plain files. The synchronous node:sqlite driver blocks the JavaScript thread for the duration of each single-statement call, which is fine at domain-data scale but worth accounting for at high write rates.
Two fields: the database path and the journal mode. :memory: opens an in-process database whose contents disappear with the process.
- name: '@deepseek-ai/dsh-storage'
- name: '@deepseek-ai/dsh-storage-sqlite'
config:
path: /var/lib/dsh/data.db
- name: '@deepseek-ai/dsh-storage-domain'
config:
backend: sqlite
| Field | Default | Meaning |
|---|---|---|
path |
required | SQLite database file path, or :memory: |
journalMode |
wal |
Journal mode: wal, delete, truncate, or persist |
wal suits local disks; a rollback-journal mode (delete/truncate/persist) fits filesystems where WAL's shared-memory files do not work, such as network mounts. The generated configuration catalog is the exhaustive source for every accepted field and its JSDoc.
Missing directories and database files are created owner-only (0o700/0o600); an existing database keeps its modes. A unit whose stored format version differs from its descriptor rejects version-mismatch, and a database stamped with a physical layout version other than the current one rejects outright — no migration, pre-release stance. Failures carry stable StorageError codes, and writes are durable once resolved.
Read these pages when this backend's view is not enough: the subsystem reference is the authoritative contract, and the sibling backend shows the alternative medium.
Nothing. This backend contributes no prompt, tool, or schema; it persists non-session domain data behind ctx.storage for host-side consumers only.
Zero live-request tokens.
None — the backend never touches live request prefixes.
These limits define when this backend is a poor fit or needs special operational care. They are current package constraints, not a task backlog.
DatabaseSync call; the block lasts a single statement, which is acceptable at domain-data scale.user_version is rejected rather than migrated (pre-release stance).openDatabase and session-query-sqlite both enforce SQLite file ownership, but each package owns a distinct application identity and schema; no shared medium helper couples them.