import of Diogenes 0.9.18
[diogenes.git] / include / diogenes / templates / database-debug.tpl
diff --git a/include/diogenes/templates/database-debug.tpl b/include/diogenes/templates/database-debug.tpl
new file mode 100644 (file)
index 0000000..fdce435
--- /dev/null
@@ -0,0 +1,29 @@
+{foreach item=query from=$trace_data}
+<table class="light" style="width: 100%; font-family: monospace">
+  <tr>
+    <td><strong>QUERY:</strong><br />{$query.query}</td>
+  </tr>
+  {if $query.error}
+  <tr>
+    <td><strong>ERROR:</strong><br />{$query.error}</td>
+  </tr>
+  {/if}
+</table>
+{if $query.explain}
+<table class="light" style="width: 100%; font-family: monospace">
+  <tr>
+    {foreach key=key item=item from=$query.explain[0]}
+    <th>{$key}</th>
+    {/foreach}
+  </tr>
+  {foreach item=explain_row from=$query.explain}
+  <tr>
+    {foreach item=item from=$explain_row}
+    <td>{$item}</td>
+    {/foreach}
+  </tr>
+  {/foreach}
+</table>
+{/if}
+<br />
+{/foreach}