3 ms·
I hate SQLAlchemy and Alembic.* I still use them both, because they are at least some kind of standard and SQLAlchemy plays with FastAPI very nicely - and I lov
by amenod 6y ago
I hate SQLAlchemy and Alembic.* I still use them both, because they are at least some kind of standard and SQLAlchemy plays with FastAPI very nicely - and I love API input validation and docs for free.
Don't get me wrong - it's nice that there is some abstraction layer above the database. However, when it doesn't work the way you want it to, you need to find some workarounds for things that are otherwise trivial in SQL.
Alembic... meh. Just give me the SQL and I will migrate database, no problem. But looking for the yet another syntax to perform the same thing is not my idea of fun. Not to mention that all migrations I ever did were linear - I can't imagine why someone would need dependency resolution in a db migration tool. Still, it is a kind of standard, so if you are working as part of a team... shrugs
* edit: to be exact, I don't really hate hate them... I am just very frustrated with them from time to time. :)
- pm 6y agoI was using SQLAlchemy with FastAPI and databases, but still had issues with the lack of async in SQLAlchemy, even though it's supposed to be coming in 2.0. Ended up moving to Tortoise ORM, which is an async copy of Django ORM, but there are some odd design decisions, and I'm not a fan of the way it plays with pydantic. I've yet to try a migration with it too, so the jury's out whether it was a worthwhile decision.
- deleted 6y ago[deleted]