40 lines
1.2 KiB
Python
40 lines
1.2 KiB
Python
import asyncio
|
|
import os
|
|
import sys
|
|
from sqlalchemy import select
|
|
from datetime import datetime
|
|
|
|
# Add backend directory to path
|
|
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
|
|
|
from app.database import get_db
|
|
from app.models.db import Position
|
|
|
|
async def inspect_sun_positions():
|
|
async for session in get_db():
|
|
try:
|
|
# List all positions for Sun
|
|
stmt = select(Position.time).where(Position.body_id == '10').order_by(Position.time.desc()).limit(10)
|
|
result = await session.execute(stmt)
|
|
times = result.scalars().all()
|
|
|
|
print("Recent Sun positions:")
|
|
for t in times:
|
|
print(f" - {t} (type: {type(t)})")
|
|
|
|
# Check specifically for 2025-12-04
|
|
target = datetime(2025, 12, 4, 0, 0, 0)
|
|
stmt = select(Position).where(
|
|
Position.body_id == '10',
|
|
Position.time == target
|
|
)
|
|
result = await session.execute(stmt)
|
|
pos = result.scalar()
|
|
print(f"\nExact match for {target}: {pos}")
|
|
|
|
finally:
|
|
break
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(inspect_sun_positions())
|