r/FastAPI • • Jan 08 '25

Question What's the benefit of sqlmodel in fastapi?

I think using sqlalchamy is enough so why using sqlmodel especially when it adds another extra layer; what's the benefti?

16 Upvotes

24 comments sorted by

View all comments

Show parent comment

7

u/bluewalt Jan 08 '25

I'll add that when you're trying to learn a new and vast topic like SQLAlchemy, it's a pain in the ass to understand what is related to SQLAlchemy, or not, because you're dealing with an abstraction. So you import stuff from sqlmodel, without knowing if it's sqlmodel or sqlalchemy (or even Pydantic). It very confused me.