(key: string, value: string)
| 88 | } |
| 89 | |
| 90 | static set(key: string, value: string): void { |
| 91 | this.init(); |
| 92 | try { |
| 93 | const stmt = this.db.prepare(` |
| 94 | INSERT OR REPLACE INTO config (key, value, updated_at) |
| 95 | VALUES (?, ?, CURRENT_TIMESTAMP) |
| 96 | `); |
| 97 | stmt.run(key, value); |
| 98 | } catch (error) { |
| 99 | console.error("保存配置失败:", error); |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | static getAll(): { [key: string]: string } { |
| 104 | this.init(); |
no test coverage detected