I've worked for close to a decade with Django's ORM and recently with TypeORM, both have been simple to use and generally (minus some weird things I tried to do) a pleasure. I recently started working with a not so important project at my current job with sqlalchemy because I had to use Flask, I cannot describe the pain I've felt working with this, I dread having to write yet another query with sqlalchemy. The docs are terrible, some of the worst I've ever seen, an obscure and undocumented government library I'm also using at work has been easier to learn by reading its code than sqlalchemy. Someone above mentioned that the new 2.0 docs are better, I seriously hope they are, they will make my suffering more tolerable. However, even if the docs are good the API is still the worst and least intuitive I've ever seen, it honestly feels like I'm writing raw sql code shaped like python code. But it is weird, non standard and difficult to follow, unlike the official python sql interface. I recently had to write an upset and it felt like I was trying to summon a forgotten demon. It would have honestly been much easier to just write it in raw sql.
I'm sorry for the wall of text, I wanted to let you know that I'm very grateful for you suggesting that library. I hope I can migrate this (still) relatively small codebase away from sqlalchemy. I'm going to give pugsql and peewee a try, both have been mentioned in this thread as good alternatives.
I can summarize my basic complain here: the abstraction layer that sqlalchemy provides is more complex than SQL itself. It's almost not worth it, add to that the docs are a huge mess and you get something only diehards and people who have been using it for decades want to use.
> Someone above mentioned that the new 2.0 docs are better, I seriously hope they are, they will make my suffering more tolerable. However, even if the docs are good the API is still the worst and least intuitive I've ever seen
Thats Exactly my experience using SqlAlchemy on previous project , which i choose to do with Starlite framework. The pain is horrible. I don't want to even touch writing another query , even if it is a simple CRUD .
>However, even if the docs are good the API is still the worst and least intuitive I've ever seen, it honestly feels like I'm writing raw sql code shaped like python code. But it is weird, non standard and difficult to follow, unlike the official python sql interface. I recently had to write an upset and it felt like I was trying to summon a forgotten demon. It would have honestly been much easier to just write it in raw sql.
At this point , only DjangoORM is fun , and even raw SQL is a lot more fun than SQLAlchemy .. I had looked into docs and it seems that not much is improved. API still have many ways to do a single thing , returning a bit different results .
I don't understand why Python Community embrace SQLAlchemy and touted it as best ORM in the world , while it breaks all the Zen of python. Even plain old SQL statements are closer to Philisophy of python.
pugsql looks a lot of fun but when i checked the last commit , it was almost a year ago..
I'm sorry for the wall of text, I wanted to let you know that I'm very grateful for you suggesting that library. I hope I can migrate this (still) relatively small codebase away from sqlalchemy. I'm going to give pugsql and peewee a try, both have been mentioned in this thread as good alternatives.
I can summarize my basic complain here: the abstraction layer that sqlalchemy provides is more complex than SQL itself. It's almost not worth it, add to that the docs are a huge mess and you get something only diehards and people who have been using it for decades want to use.