dsh-storage-mysql
在终端中运行以下命令:
dsh plugin install sandersyao/dsh-storage-mysql
将以下提示词粘贴到 DeepSeek Harness 对话框中:
在 DeepSeek Harness 中执行 dsh plugin install sandersyao/dsh-storage-mysql 即可安装该 MySQL 存储后端插件,源码地址为 https://github.com/sandersyao/dsh-storage-mysql。
插件介绍
The default JSON-file storage in DeepSeek Harness hits its limits under multi-process loads, containerized rollouts, or production uptime requirements: file locks become a bottleneck, crash recovery is best-effort at best, and data is invisible to other processes. dsh-storage-mysql replaces that backend with a contract-equivalent MySQL/InnoDB implementation, making every write a single atomic SQL statement—once resolved the row is durable, surviving crashes and reopens, and visible across processes.
The plugin exposes the same KV surface as dsh-storage-json: loadAll returns a transactional snapshot, putRecord performs an upsert, deleteRecord is idempotent, setGlobal updates unit-level metadata, and close releases the handle. Connection settings are read entirely from environment variables or a .env file; independent STORAGE_* keys take priority and fall back to shared MYSQL_* keys so the plugin can coexist with dsh-credentials-mysql and dsh-session-persistence-mysql on one connection. On startup it runs idempotent CREATE TABLE IF NOT EXISTS and validates the schema version, failing closed on any downgrade rather than silently migrating.
If you run DeepSeek Harness as multiple instances or in containers, already operate a MySQL estate, or simply want to move the storage layer from local JSON files to an ACID-guaranteed relational database without touching business code, this plugin is a drop-in backend switch.
截图预览
使用场景
- 多进程或容器化部署下替代本地 JSON 文件存储
- 需要崩溃恢复与跨进程数据可见性的生产环境
- 与 dsh-credentials-mysql 和 dsh-session-persistence-mysql 共用同一 MySQL 实例
- 需要 ACID 持久化保障的长期运行服务
适合人员
- 在生产环境运行 DeepSeek Harness 的 DevOps 工程师
- 需要 ACID 持久化保障的 dsh 插件开发者
- 已运营 MySQL 基础设施的工程团队