import json import sqlite3 PROMPTS_FILE = "prompts.jsonl" DB_PATH = "business_data.db" # Update if your DB file is different def check_prompts(prompts_file, db_path): with open(prompts_file, "r", encoding="utf-8") as f: lines = f.readlines() conn = sqlite3.connect(db_path) cursor = conn.cursor() for i, line in enumerate(lines, 1): try: entry = json.loads(line) prompt = entry.get("prompt") sql = entry.get("sql") cursor.execute(sql) rows = cursor.fetchall() if rows: print(f"[{i}] Prompt: {prompt}\n ✅ Returned {len(rows)} rows.") else: print(f"[{i}] Prompt: {prompt}\n ⚠️ No data returned.") except Exception as e: print(f"[{i}] Prompt: {prompt}\n ❌ Error: {e}") conn.close() if __name__ == "__main__": check_prompts(PROMPTS_FILE, DB_PATH)