import asyncio

from database.postgres_helper import get_db_connection


async def main():
    db = get_db_connection()
    sql = "SELECT magento_ref_code, product_name, product_line_vn FROM dm_dim_product_inventory_consolidation WHERE product_line_vn LIKE '%lót%' OR product_name LIKE '%sịp%' LIMIT 50"
    rows = await db.execute_query_async(sql)
    print(f"Found {len(rows)} products")
    for r in rows:
        if r['product_line_vn'] not in ['Áo lót']:
            print(r)

if __name__ == '__main__':
    asyncio.run(main())
