feat: filter and search by tag

This commit is contained in:
2026-02-03 09:53:08 +01:00
parent cb11e34798
commit 229223f77a
9 changed files with 147 additions and 14 deletions

View File

@ -155,7 +155,13 @@ func (s *SQLiteStorage) Search(query string) []*note.Note {
SELECT id, path, title, content, updated_at, size, published
FROM notes
WHERE lower(content) LIKE lower(?)
`, pattern)
OR id IN (
SELECT nt.note_id
FROM note_tags nt
JOIN tags t ON t.id = nt.tag_id
WHERE lower(t.name) LIKE lower(?)
)
`, pattern, pattern)
if err != nil {
return []*note.Note{}
}