15 lines
388 B
Python
15 lines
388 B
Python
import asyncio
|
|
from sqlalchemy import text
|
|
from app.database import engine
|
|
|
|
async def run_query():
|
|
async with engine.connect() as conn:
|
|
result = await conn.execute(text("SELECT * FROM sleep_session"))
|
|
rows = result.all()
|
|
print(f"Total rows: {len(rows)}")
|
|
for row in rows:
|
|
print(row)
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(run_query())
|