fix: update database with 499 workflow templates and working FTS5 index

- Database now contains 499 templates (was 399)
- FTS5 index properly populated with all template entries
- Fixed quote escaping in FTS5 queries to prevent syntax errors
- Verified FTS5 search returns correct results (162 for "webhook")
- Fixes template search in Docker deployments

The previous database had empty FTS5 tables causing search to fail.
This update ensures the FTS5 index is properly synchronized and
handles special characters in search queries.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
czlonkowski
2025-07-10 13:20:29 +02:00
parent c9aadfcb30
commit 53d8c8452f
2 changed files with 6 additions and 2 deletions

Binary file not shown.

View File

@@ -192,8 +192,12 @@ export class TemplateRepository {
} }
try { try {
// Use FTS for search // Use FTS for search - escape quotes in terms
const ftsQuery = query.split(' ').map(term => `"${term}"`).join(' OR '); const ftsQuery = query.split(' ').map(term => {
// Escape double quotes by replacing with two double quotes
const escaped = term.replace(/"/g, '""');
return `"${escaped}"`;
}).join(' OR ');
logger.debug(`FTS5 query: ${ftsQuery}`); logger.debug(`FTS5 query: ${ftsQuery}`);
const results = this.db.prepare(` const results = this.db.prepare(`