import asyncio, json, sys
sys.stdout.reconfigure(encoding='utf-8')
sys.path.insert(0, r'd:\cnf\chatbot-canifa-dev-experimental\backend')

from common.starrocks_connection import get_db_connection

async def main():
    db = get_db_connection()
    rows = await db.execute_query_async(
        "SELECT product_name, LEFT(description_text, 400) as desc_text, "
        "product_line_vn, master_color, style, fitting "
        "FROM shared_source.magento_product_dimension_with_text_embedding "
        "WHERE description_text IS NOT NULL AND description_text != '' "
        "LIMIT 5"
    )
    for r in rows:
        print(json.dumps(r, ensure_ascii=False, default=str))
        print("---")

asyncio.run(main())
