templates: Append SQL query information in debug mode

![auswahl_076](https://f.cloud.github.com/assets/141300/665271/c6b7a528-d798-11e2-890e-c2013167c46e.png)