Spaces:
Paused

File size: 404 Bytes
3143c25
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

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())