← Back to context

Comment by Noumenon72

13 hours ago

I'm using SQLAlchemy, Alembic, and FastAPI. Either this is for someone much more advanced than me, or it could use some examples showing "This is clunky in SQLAlchemy and easy in Advanced-Alchemy." When you look at SQLModel[1] from FastAPI, which I did adopt, it does a much better job at promising "this will make your life easier".

1. https://sqlmodel.tiangolo.com/

I don't like SQLModel for the simple reason that it muddles boundaries between different parts of the application. I suppose when you have a pure CRUD app it's ok, but anytime you want to handle ORM objects and apply some business logic; you'll want to cleanly separate those from what you send and receive from your API.

Hello, OP there, I have many use cases that fall outside of FastAPI or web apps in general, and this pattern allows me to consolidate that logic in a re-usable way.

We also have SQLSpec[1] (Work in progress) that could maybe a better use case for you with raw SQL

1. https://github.com/litestar-org/sqlspec

FastAPI and it's very opinionated "ecosystem" of "easy to use" and "hipster-esque documented" tools are fast-becoming a horrible one-man show version of Django, and we will all regret going so deep into it using it, one day. Until then, sure we can use it and it mostly makes sense and it mostly works really very well. Hopefully the community matures and moves away from opinionated tooling that forces you into the "one true way".