(db: DatabaseAdapter)
| 389 | * Check whether the segment table exists and has at least one row. |
| 390 | */ |
| 391 | export function hasSessionIndex(db: DatabaseAdapter): boolean { |
| 392 | if (!hasTable(db, 'segment')) return false |
| 393 | try { |
| 394 | const row = db.prepare('SELECT COUNT(*) as count FROM segment').get() as { count: number } | undefined |
| 395 | return (row?.count ?? 0) > 0 |
| 396 | } catch { |
| 397 | return false |
| 398 | } |
| 399 | } |
| 400 | |
| 401 | /** |
| 402 | * Session index statistics: count, existence flag, and gap threshold from meta. |
no test coverage detected