From 44afbbcd588085978d038f7d12c230fcf6a8c3cf Mon Sep 17 00:00:00 2001 From: Vito Sansevero Date: Wed, 28 May 2025 13:00:19 -0700 Subject: [PATCH] fix(database): handle empty categories in query --- database/operations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/operations.py b/database/operations.py index 122d23f..fcf009a 100644 --- a/database/operations.py +++ b/database/operations.py @@ -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()]