3 ms·
Yes, and there is a cognitive overhead to think SQL queries both in Django ORM syntax and SQL and when should I switch between ORM syntax and raw_sql, when shou
by dirtyaura 14y ago
Yes, and there is a cognitive overhead to think SQL queries both in Django ORM syntax and SQL and when should I switch between ORM syntax and raw_sql, when should I implement custom manager etc.
Our codebase is an enterprise app and it has maybe a ratio of 50/50 between complex queries and straightforward single table selects or simple joins. I much prefer SQLAlchemy Core: I can think a complex query in SQL, try it in sql shell and implement it in SQLAlchemy Core so that the resulting code resembles the actual query. This resemblance also helps a lot of when you do performance optimizations.