{% extends "flask_deck/base.html" %} {% block content %}

Read-Only SQL Console

SELECT / WITH / EXPLAIN only · rolled-back transaction · auto-redacts sensitive columns · max {{ config.sql_console_max_rows }} rows

READ-ONLY GUARD {% if sql_presets %} Presets: {% for plabel, psql in sql_presets %} {% endfor %} {% endif %}
{% for tbl in tables[:6] %} {% endfor %}
Every execution is audited in the Audit Ledger.
{% if result %} {% if result.error %} {% else %}
{{ result.row_count }} row(s) · {{ "%.2f"|format(result.duration_ms) }} ms {% if result.truncated %}TRUNCATED AT {{ config.sql_console_max_rows }}{% endif %} {% if result.redacted_columns %}REDACTED: {{ result.redacted_columns | join(", ") }}{% endif %}
{% for col in result.columns %}{% endfor %} {% for row in result.rows %} {% for cell in row %} {% endfor %} {% else %} {% endfor %}
{{ col }}
{% if cell == '[REDACTED]' %} [REDACTED] {% elif cell is none %} NULL {% else %} {{ cell }} {% endif %}
Query returned 0 rows.
{% endif %} {% endif %}
{% endblock %}