fix: make FTS5 optional for template search (fixes Claude Desktop compatibility)

- Added runtime FTS5 detection in database adapters
- Removed FTS5 from required schema to prevent "no such module" errors
- FTS5 tables/triggers created conditionally only if supported
- Template search automatically falls back to LIKE when FTS5 unavailable
- Works in ALL SQLite environments (Claude Desktop, restricted envs, etc.)

This ensures search_templates() works correctly regardless of SQLite build,
while still providing optimal performance when FTS5 is available.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
czlonkowski
2025-07-10 12:13:08 +02:00
parent d8e84307e4
commit e8f6b684f0
5 changed files with 149 additions and 11 deletions

View File

@@ -132,6 +132,11 @@ export class TemplateService {
}
logger.info(`Successfully saved ${saved} templates to database`);
// Rebuild FTS5 index after bulk import
logger.info('Rebuilding FTS5 index for templates');
this.repository.rebuildTemplateFTS();
progressCallback?.('Complete', saved, saved);
} catch (error) {
logger.error('Error fetching templates:', error);