32 lines
1.1 KiB
Python
32 lines
1.1 KiB
Python
import asyncio
|
|
import sys
|
|
import os
|
|
|
|
sys.path.append(os.path.join(os.getcwd(), "backend"))
|
|
|
|
from app.database import AsyncSessionLocal
|
|
from sqlalchemy import select
|
|
from app.models.db.star_system import StarSystem
|
|
from app.models.db.celestial_body import CelestialBody
|
|
|
|
async def check_sirius():
|
|
async with AsyncSessionLocal() as session:
|
|
# Check Star Systems
|
|
print("Checking Star Systems:")
|
|
stmt = select(StarSystem).where(StarSystem.name.ilike('%Sirius%'))
|
|
result = await session.execute(stmt)
|
|
systems = result.scalars().all()
|
|
for s in systems:
|
|
print(f"System: {s.name} ({s.name_zh}), ID: {s.id}, Pos: {s.position_x}, {s.position_y}, {s.position_z}")
|
|
|
|
# Check Celestial Bodies
|
|
print("\nChecking Celestial Bodies:")
|
|
stmt = select(CelestialBody).where(CelestialBody.name.ilike('%Sirius%'))
|
|
result = await session.execute(stmt)
|
|
bodies = result.scalars().all()
|
|
for b in bodies:
|
|
print(f"Body: {b.name} ({b.name_zh}), ID: {b.id}, Type: {b.type}, SystemID: {b.system_id}")
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(check_sirius())
|