Spaces:
Paused
Paused
Download scratch/inspect_db.py from 3SCError404/miracle: direct link, hf CLI and curl.
- Browser
- Download file 507 Bytes
-
https://huggingface.co/spaces/3SCError404/miracle/resolve/main/scratch/inspect_db.py
- Command line
-
hf download hf://spaces/3SCError404/miracle/scratch/inspect_db.py
-
curl -L -o inspect_db.py https://huggingface.co/spaces/3SCError404/miracle/resolve/main/scratch/inspect_db.py
507 Bytes
| import asyncio | |
| from sqlalchemy import select | |
| from core.database import async_session_factory | |
| from models.user import User | |
| async def check_users(): | |
| async with async_session_factory() as db: | |
| u_res = await db.execute(select(User)) | |
| users = u_res.scalars().all() | |
| print("\nAll Users:") | |
| for u in users: | |
| print(f"ID: {u.id}, Email: {u.email}, Name: {u.full_name}, Global Role: {u.global_role}") | |
| if __name__ == "__main__": | |
| asyncio.run(check_users()) | |