-
PyPika
PyPika is a python SQL query builder that exposes the full richness of the SQL language using a syntax that reflects the resulting query. PyPika excels at all sorts of SQL queries but is especially useful for data analysis.
-
Scout Monitoring
Free Django app performance insights with Scout Monitoring. Get Scout setup in minutes, and let us sweat the small stuff. A couple lines in settings.py is all you need to start monitoring your apps. Sign up for our free tier today.
Agreed. I will never recommend an ORM, things simply spiraled out of control for medium to large-ish projects that had more than 2 developers. Even with "best practices", code ended up having a mix of raw SQL and ORM-style queries, and it was hard to reason about the code.
Since switching to asyncpg [0] these problems have vanished. It commands a deeper knowledge of actual SQL, but I would argue this knowledge is absolutely necessary and one of the disadvantages of an ORM is that it makes the SQL that is eventually run opaque.
Not sure if there are equivalents to asyncpg for other RDBMS's.
[0]: https://github.com/MagicStack/asyncpg
There is a middle-ground between writing SQL statement strings in your code, and a full-blown ORM: query builders. At least in my experience with small to medium projects, these have far fewer footguns while keeping the code composable and readable. Here's one for Python: https://github.com/kayak/pypika
The beauty of the Django ecosystem, is that you have packages for everything: djangopackages.org
E.G: https://github.com/Arisophy/django-compositepk-model
Related posts
-
PyPy has been working for me for several years now
-
Can I learn Python while practicing writing queries for SQL simultaneously? I've recently completed learning SQL and trying to get better at it.
-
Installing psycopg2==2.8.6 throws an error
-
Uploading CSVs to a SQL table using Python
-
Integrate PostgreSQL Database In Python - A Hands-On Guide