Spaces:
Paused

miracle / scratch /list_users.py
dushyantsingh0
backend stabilization
3143c25
Raw History Blame Contribute Delete
404 Bytes
import asyncio
from sqlalchemy import select
from core.database import async_session_factory
from models.user import User
async def list_users():
async with async_session_factory() as db:
res = await db.execute(select(User))
for u in res.scalars().all():
print(f"EMAIL: {u.email}, GLOBAL_ROLE: {u.global_role}")
if __name__ == "__main__":
asyncio.run(list_users())