teszt állományok áthelyezése és szelektálása
This commit is contained in:
16
tests/archive/check_db.py.old
Normal file
16
tests/archive/check_db.py.old
Normal file
@@ -0,0 +1,16 @@
|
||||
import asyncio
|
||||
from sqlalchemy import select
|
||||
from app.db.session import AsyncSessionLocal
|
||||
from app.models.identity import User
|
||||
from app.models.marketplace.organization import Organization
|
||||
|
||||
async def check():
|
||||
async with AsyncSessionLocal() as db:
|
||||
u = (await db.execute(select(User).limit(5))).scalars().all()
|
||||
o = (await db.execute(select(Organization).limit(5))).scalars().all()
|
||||
print(f"Users: {len(u)}")
|
||||
print(f"Orgs: {len(o)}")
|
||||
if u: print(u[0].id)
|
||||
if o: print(o[0].id)
|
||||
|
||||
asyncio.run(check())
|
||||
Reference in New Issue
Block a user