(dbPath: string = QODEX_SESSION_DB)
| 88 | private db: Database.Database; |
| 89 | |
| 90 | constructor(dbPath: string = QODEX_SESSION_DB) { |
| 91 | this.db = openDatabase(dbPath); |
| 92 | this.db.exec(SCHEMA); |
| 93 | // Migrate DBs created before deliver/recipe existed. ADD COLUMN throws on an existing |
| 94 | // column, so each is guarded — idempotent and safe to run every startup. |
| 95 | for (const col of ['deliver TEXT', 'recipe TEXT']) { |
| 96 | try { this.db.exec(`ALTER TABLE schedules ADD COLUMN ${col}`); } catch { /* already present */ } |
| 97 | } |
| 98 | try { this.db.exec(`ALTER TABLE schedule_runs ADD COLUMN receipt TEXT`); } catch { /* already present */ } |
| 99 | } |
| 100 | |
| 101 | add(input: { |
| 102 | name: string; |
nothing calls this directly
no test coverage detected