Has anyone comes across a SQL templating engine which allows one to mix SQL with a dynamic language like Ruby or Python?
I'm looking for something similar to Ruby erb templates. For example, in Ruby on Rails you can have various templates for a view:
customers.html.erb (html + ruby)
customers.js.erb (javascript + ruby)
Though I want something like:
customers.sql.erb
The output could be a text string result of the ad-hoc SQL mixed with Ruby code. Or even, if it's Python-based that's fine too.