r/Python • u/sheadipeets5 from __future__ import 4.0 • Jun 15 '26
Discussion Are we happy with SQLAlchemy?
I really need the community's opinion on this. I've worked with a lot of ORMs, from Entity Framework to DrizzleORM. SQLAlchemy is the best option we have in the Python ecosystem, but it still sucks compared to ORMs in other ecosystems.
When I was working with Go, I discovered sqlc and loved it. It's great, but not enough to replace a full ORM because of its limitations (no dynamic queries).
For the last five months, I've been building my own equivalent for Python, powered by sqlglot. Unlike sqlc, it has dynamic filters, sorting, and partial updates. It also has a single parameter syntax for all supported dialects (:param), which are Postgres, MySQL, SQLite, DuckDB, and ClickHouse. I borrowed sqlc's end-to-end test cases, and my version passes all of them now.
It has already replaced SQLAlchemy for me in several microservices. So I guess my question is: is it worth continuing to build it? Because I don’t really know if other Python devs need such tool.
I've had a lot of fun building the current version, and I have a long roadmap ahead. That includes migrations (with auto-generation when possible), generators for other languages, and much more.
View all comments
Show parent comment
3
u/buddyleex Jun 15 '26
I actually have an app in Django that has tables of 300k-600k records each and instead of calling data from each I just create another model/table to aggregate that data via FK. No idea if that is the right way because I’m no expert in any of this. First iterations were extremely slow and I’ve had to enhance it a bit for speed because as you can imagine that is a lot of data.