first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 22:25:19 +03:00
commit 361dbef019
25 changed files with 814 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
from typing import Optional
from sqlmodel import Session, select
from app.models.models import User
def get_user_by_email(session: Session, email: str) -> Optional[User]:
statement = select(User).where(User.email == email)
return session.exec(statement).first()
def create_user(session: Session, email: str, hashed_password: Optional[str]) -> User:
user = User(email=email, hashed_password=hashed_password)
session.add(user)
session.commit()
session.refresh(user)
return user