News for hackers. Stuff that matters.
Re:What ORMs have taught me: just learn SQL by dharbin on Monday August 04, 2014 @05:48PM (#8134245)
I'm loving all the momentum towards writing templated-sql, in fact, I wrote a library for this myself[1].

By leveraging jinja2/django-style template inheritance, you can even bring some advantages of ORMs (composition, reuse, and extending) into the raw-sql world.

The OP also intimated that he's taking a templated approach:

"“In these cases, I've elected to write queries using a templating system and describe the tables using the ORM. I get the convenience of an application level description of the table with direct use of SQL. It's a lot less trouble than anything else I've used so far.”

[1] https://github.com/civitaslearning/swigql

Re:What ORMs have taught me: just learn SQL by jdotjdot on Monday August 04, 2014 @06:32PM (#8134446)
If you're at all interested in opening a kick starter for such a templating library for Django, I'd back it. I have attribute creep all the time and actually generally prefer raw SQL with the exception of its verbosity. The problem is, migrations are awful and SQL injection mistakes easy to come by. Would be great to have the best of both worlds in a SQL templating engine + sort-of ORM wrapper that auto-generates via SQL inspection
Re:What ORMs have taught me: just learn SQL by kyllo on Monday August 04, 2014 @07:03PM (#8134557)
Without the ORM, though, what would be the point of using Django? To me it seems like this would be a better fit for a more minimalist platform like Flask.
Re:What ORMs have taught me: just learn SQL by crazytony on Monday August 04, 2014 @07:38PM (#8134690)
not sure I follow? Most sql templates I have seen behave like Django's .raw() function (which inspects the resultset and auto binds to the object)