import sqlite3
import json

db_path = 'canifa_ai_dump.sqlite'
try:
    conn = sqlite3.connect(db_path)
    c = conn.cursor()
    # Find rows where description_data_full is short or only contains mau_sac
    c.execute("SELECT magento_ref_code, description_data_full FROM sr__test_db__magento_product_dimension_with_text_embedding WHERE description_data_full LIKE '%mau_sac%' AND length(description_data_full) < 100 LIMIT 10")
    rows_mau_sac = c.fetchall()
    
    print("--- Rows with short JSON / only mau_sac ---")
    for r in rows_mau_sac:
        print(r)

    c.execute("SELECT magento_ref_code, description_data_full FROM sr__test_db__magento_product_dimension_with_text_embedding WHERE description_data_full NOT LIKE '{%' LIMIT 5")
    rows_invalid = c.fetchall()
    print("\n--- Rows not starting with { ---")
    for r in rows_invalid:
        print(r)

except Exception as e:
    print(f"Error in {db_path}: {e}")
