import asyncio from packages.core.database import AsyncSessionLocal from sqlalchemy import text async def main(): async with AsyncSessionLocal() as session: r = await session.execute(text("select hs_code, product_name, origin_country, destination_country, departure_port, arrival_port, transport_mode from standard_trade_records limit 5")) for row in r: print(f"HS: {row[0]}") print(f"Product: {row[1]}") print(f"Origin -> Dest: {row[2]} -> {row[3]}") print(f"Port Dep -> Arr: {row[4]} -> {row[5]}") print(f"Transport: {row[6]}") print("---") asyncio.run(main())