fix(database): handle empty categories in query

This commit is contained in:
Vito Sansevero
2025-05-28 13:00:19 -07:00
parent 861dbd8a12
commit 44afbbcd58
+1 -1
View File
@@ -361,7 +361,7 @@ class PromptDatabase:
"""
with self.model.get_connection() as conn:
cursor = conn.execute(
"SELECT DISTINCT category FROM prompts WHERE category IS NOT NULL ORDER BY category"
"SELECT DISTINCT TRIM(category) as category FROM prompts WHERE category IS NOT NULL AND TRIM(category) != '' ORDER BY category"
)
return [row['category'] for row in cursor.fetchall()]