teszt állományok áthelyezése és szelektálása

This commit is contained in:
Roo
2026-06-05 10:50:25 +00:00
parent 18524a08f2
commit f03b5f3916
63 changed files with 633 additions and 527 deletions

View File

@@ -0,0 +1,31 @@
import asyncio
from sqlalchemy import text
from app.db.session import AsyncSessionLocal
async def main():
async with AsyncSessionLocal() as session:
print("--- TASK 1: BRANCHES (GARAGES) ---")
try:
result = await session.execute(text("SELECT id, organization_id, name FROM fleet.branches;"))
branches = result.fetchall()
print("| id | organization_id | name |")
print("|---|---|---|")
for b in branches:
print(f"| {b.id} | {b.organization_id} | {b.name} |")
except Exception as e:
print(f"Error querying fleet.branches: {e}")
print("\n--- TASK 2: ASSETS (VEHICLES) ---")
try:
# We will query all assets and print the relevant columns.
result = await session.execute(text("SELECT id, license_plate, owner_person_id, owner_org_id, branch_id FROM vehicle.assets LIMIT 50;"))
assets = result.fetchall()
print("| id | license_plate | owner_person_id | owner_org_id | branch_id |")
print("|---|---|---|---|---|")
for a in assets:
print(f"| {a.id} | {a.license_plate} | {a.owner_person_id} | {a.owner_org_id} | {a.branch_id} |")
except Exception as e:
print(f"Error querying vehicle.assets: {e}")
if __name__ == "__main__":
asyncio.run(main())