(db: DatabaseAdapter)
| 15 | * Check if FTS virtual table exists in the database. |
| 16 | */ |
| 17 | export function hasFtsTable(db: DatabaseAdapter): boolean { |
| 18 | try { |
| 19 | const row = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='message_fts'").get() |
| 20 | return !!row |
| 21 | } catch { |
| 22 | return false |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * Create FTS virtual table if it doesn't exist. |
no test coverage detected