from app.core.database import engine
from sqlmodel import Session, select
from app.models.favorite import Favorite
from app.models.user import User

def check_db():
    with Session(engine) as session:
        favorites = session.exec(select(Favorite)).all()
        print(f"Total favorites: {len(favorites)}")
        for f in favorites:
            print(f"User: {f.user_id}, Type: {f.item_type}, ID: {f.item_id}, Name: {f.item_name}")
        
        users = session.exec(select(User)).all()
        print(f"Total users: {len(users)}")
        for u in users:
            print(f"User ID: {u.id}, Email: {u.email}, Role: {u.role}")

if __name__ == "__main__":
    check_db()
