(db: DatabaseAdapter)
| 94 | * Count of chat sessions that have an AI-generated summary. |
| 95 | */ |
| 96 | export function getSummaryCount(db: DatabaseAdapter): number { |
| 97 | if (!hasTable(db, 'segment')) return 0 |
| 98 | const row = db.prepare("SELECT COUNT(*) as count FROM segment WHERE summary IS NOT NULL AND summary != ''").get() as |
| 99 | | { count: number } |
| 100 | | undefined |
| 101 | return row?.count ?? 0 |
| 102 | } |
| 103 | |
| 104 | /** |
| 105 | * Get the latest platform_message_id (used as incremental import boundary). |
no test coverage detected