(key: string)
| 48 | if (!this.db) { |
| 49 | console.error("[convert] DB not initialized, cannot get config."); |
| 50 | return ""; |
| 51 | } |
| 52 | try { |
| 53 | const row = this.db.prepare("SELECT value FROM config WHERE key = ?").get(key) as { value: string } | undefined; |
| 54 | return row ? row.value : ""; |
| 55 | } catch (error) { |
| 56 | console.error("[convert] Failed to read config:", error); |
| 57 | return ""; |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | static set(key: string, value: string): void { |
| 62 | this.init(); |
| 63 | if (!this.db) { |
| 64 | console.error("[convert] DB not initialized, cannot set config."); |
| 65 | return; |
| 66 | } |
no test coverage detected