(options: { key: string })
| 2 | import { ensureInitialized } from "./util.js"; |
| 3 | |
| 4 | export function deleteCommand(options: { key: string }): void { |
| 5 | const dbPath = ensureInitialized(); |
| 6 | const db = openDatabase(dbPath); |
| 7 | const existing = getFact(db, options.key); |
| 8 | |
| 9 | if (!existing) { |
| 10 | console.log(`No fact found with key: ${options.key}`); |
| 11 | db.close(); |
| 12 | return; |
| 13 | } |
| 14 | |
| 15 | deleteFact(db, options.key); |
| 16 | db.close(); |
| 17 | |
| 18 | console.log(`Deleted: ${options.key}`); |
| 19 | } |
no test coverage detected