Connect to database and add first models

This commit is contained in:
2024-05-09 19:54:59 +04:00
parent 633b0be0d9
commit e426c281b9
7 changed files with 305 additions and 0 deletions

8
database/crud.py Normal file
View File

@@ -0,0 +1,8 @@
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.future import select
from .models import *
async def get_user(db: AsyncSession, user_id: int):
return await db.get(User, user_id)