feat: ship v0.6.0 with cockpit, knowledge base, and chapter bridge
Deliver P5 writer workflow: writing cockpit, manual knowledge CRUD with review, chapter bridge with optional AI, publish status, and stock buffer reminders. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import type { SqliteDb } from '../types'
|
||||
|
||||
export class BookPrefsRepository {
|
||||
constructor(private db: SqliteDb) {}
|
||||
|
||||
get(key: string): string | null {
|
||||
const row = this.db.prepare('SELECT value FROM book_preferences WHERE key = ?').get(key) as
|
||||
| { value: string }
|
||||
| undefined
|
||||
return row?.value ?? null
|
||||
}
|
||||
|
||||
set(key: string, value: string): void {
|
||||
this.db
|
||||
.prepare(
|
||||
`INSERT INTO book_preferences (key, value) VALUES (?, ?)
|
||||
ON CONFLICT(key) DO UPDATE SET value = excluded.value`
|
||||
)
|
||||
.run(key, value)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user