{"record":{"id":"2a19f244a7bd3c4e","repo":"thedotmack/claude-mem","slug":"fts5-not-available-user-prompts-fts-skipped-sea","errorCode":null,"errorMessage":"FTS5 not available — user_prompts_fts skipped (search uses ChromaDB)","messagePattern":"FTS5 not available — user_prompts_fts skipped \\(search uses ChromaDB\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/services/sqlite/SessionStore.ts","lineNumber":1325,"sourceCode":"        VALUES('delete', old.id, old.prompt_text);\n      END;\n\n      CREATE TRIGGER user_prompts_au AFTER UPDATE ON user_prompts BEGIN\n        INSERT INTO user_prompts_fts(user_prompts_fts, rowid, prompt_text)\n        VALUES('delete', old.id, old.prompt_text);\n        INSERT INTO user_prompts_fts(rowid, prompt_text)\n        VALUES (new.id, new.prompt_text);\n      END;\n    `;\n\n    try {\n      this.db.run(ftsCreateSQL);\n      this.db.run(ftsTriggersSQL);\n    } catch (ftsError) {\n      if (ftsError instanceof Error) {\n        logger.warn('DB', 'FTS5 not available — user_prompts_fts skipped (search uses ChromaDB)', {}, ftsError);\n      } else {\n        logger.warn('DB', 'FTS5 not available — user_prompts_fts skipped (search uses ChromaDB)', {}, new Error(String(ftsError)));\n      }\n      this.db.run('COMMIT');\n      this.db.prepare('INSERT OR IGNORE INTO schema_versions (version, applied_at) VALUES (?, ?)').run(10, new Date().toISOString());\n      logger.debug('DB', 'Created user_prompts table (without FTS5)');\n      return;\n    }\n\n    this.db.run('COMMIT');\n\n    this.db.prepare('INSERT OR IGNORE INTO schema_versions (version, applied_at) VALUES (?, ?)').run(10, new Date().toISOString());\n\n    logger.debug('DB', 'Successfully created user_prompts table');\n  }\n\n  private ensureDiscoveryTokensColumn(): void {\n    const applied = this.db.prepare('SELECT version FROM schema_versions WHERE version = ?').get(11) as SchemaVersion | undefined;\n    if (applied) return;\n","sourceCodeStart":1307,"sourceCodeEnd":1343,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/8bc631a71a487424b866756e43a6efa4574cc66b/src/services/sqlite/SessionStore.ts#L1307-L1343","documentation":"Schema migration v10 creates the `user_prompts` table plus an FTS5 virtual table (`user_prompts_fts`) and sync triggers. If the SQLite build lacks FTS5, the CREATE VIRTUAL TABLE throws; the store commits the base table anyway, records schema version 10 as applied, and warns that prompt search falls back to ChromaDB.","triggerScenarios":"`db.run(ftsCreateSQL)` throws because the linked SQLite was compiled without ENABLE_FTS5 (or with SQLITE_OMIT_FTS5).","commonSituations":"Non-standard Node builds, distro-patched SQLite without FTS5, or embedded runtimes shipping a minimal SQLite.","solutions":["Accept the fallback — ChromaDB covers prompt search.","Switch to a runtime whose SQLite has FTS5 (stock Node's node:sqlite does) and recreate the store.","Verify capability with `SELECT * FROM pragma_compile_options() WHERE compile_options LIKE '%FTS5%'`."],"exampleFix":"// before\n// CREATE VIRTUAL TABLE ... USING fts5(...) throws on an FTS5-less SQLite\n// after\nconst fts5 = db.prepare(\"SELECT 1 FROM pragma_compile_options() WHERE compile_options LIKE '%ENABLE_FTS5%'\").get();\nif (fts5) {\n  db.run(ftsCreateSQL);\n  db.run(ftsTriggersSQL);\n} else {\n  // skip FTS; ChromaDB handles search\n}","handlingStrategy":"fallback","validationCode":"const fts5Available = !!db.prepare(\"SELECT 1 FROM pragma_compile_options() WHERE compile_options LIKE '%ENABLE_FTS5%'\").get();","typeGuard":null,"tryCatchPattern":"try {\n  db.run(ftsCreateSQL);\n  db.run(ftsTriggersSQL);\n} catch (ftsError) {\n  // degrade gracefully: keep the base table, rely on ChromaDB for search\n  logger.warn('DB', 'FTS5 not available — search falls back to ChromaDB', {}, ftsError);\n}","preventionTips":["Use a Node/SQLite build with FTS5 enabled (stock node:sqlite includes it).","Check pragma_compile_options once at startup and cache the capability."],"tags":["sqlite","fts5","schema-migration","search"],"backgroundTag":"sqlite-fts5-unavailable","analyzedSha":"8bc631a71a487424b866756e43a6efa4574cc66b","analyzedAt":"2026-08-20T23:58:13.836Z","contentChangedAt":"2026-08-20T23:58:13.836Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}