4 ms·
I am a big fan of SQLAlchemy, though I often use it more as an advanced pythonic query builder than as an ORM It can sometimes be a bit more work to write some
by tda 6y ago
I am a big fan of SQLAlchemy, though I often use it more as an advanced pythonic query builder than as an ORM It can sometimes be a bit more work to write something in SQLAlchemy than raw SQL, especially when doing complicated queries, but I really like composing the queries with python functions, defining CTE's, window functions, computed columns in separate functions.
And very important: any query I can write for postgres I can write with SQLAlchemy. But as I work a lot on an application with some complicated JSONB columns, I must say the syntax for set returning functions is kind of awkward. But the session and transaction management, query composability, ORM options, and overall Pythonic way you can use SQLAlchemy really beats putting (semi) raw SQL in your code. And as a bonus you can do linting, type checking and refactoring of you queries.
Thanks for all the hard work Michael!
- zzzeek 6y agoyou're welcome! Not sure if you saw that 1.4 has an all-new series of table valued function support, which previously was nonexistent, I hope it improves the situation in that area: https://docs.sqlalchemy.org/en/14/dialects/postgresql.html#table-values-table-and-column-valued-functions-row-and-tuple-objects https://docs.sqlalchemy.org/en/14/dialects/postgresql.html#t...
- tda 6y agoWow great, I was not aware. Looks like everything I could hope for, congratulations on this great release!