Hacker News new | ask | show | jobs
by sickblastoise 652 days ago
Sqlalchemy stands out as a library having probably one of the most complete and pragmatic APIs for database access across all languages.

It is no small feat to create compatibility for modern Python features like type hints and async in a library that has its roots in Python 2, it has absolutely exceeded expectations in that regard.

4 comments

> Sqlalchemy stands out as a library having probably one of the most complete and pragmatic APIs for database access across all languages.

I can't disagree more. Identity map based ORMs are _awful_ to use, in almost every way.

What's your gripe with identity map specifically? The map is bound to a session which are short lived in SQA and usually map to a single transaction.
What’s bad about them?
Sqlalchemy in general is great but the data class integration feels non pythonic to me, due perhaps to catering first to the typing crowd instead of the ergonomic one.
I felt that too but over time decided that it compromised the theoretical pythonicity for the practical compromise of being flexible enough to work properly with SQL.

One other reason for its popularity and success is how engaged the orginal developer is with the overall community.

What they need is a proper migration diff and generation tool with strong defaults. Alembic is meh and the DX is poor. Prisma and Django's migration/diff tools are the gold standard.

(There's also Atlas for Python but it isn't much better, a lot of fiddly config files https://atlasgo.io/guides/orms/sqlalchemy)

Prisma defeats the entire point of sql with it's weird almost graphql like thing. Apparently developers can't be trusted with it cause you can do big dumb in it.
Alembic is amazing. I haven't found a better tool in any language. I actually use it even when I don't use python as the main language
Agreed, SQLAlchemy impressed me a decade ago and it still does today.