{% extends 'dashboard.html' %} {% block page %}

Database Schema

Explore your database structure and run queries on your data.

Entity Relationship Diagram

erDiagram
{% for table in schema_info %}
    {{ table.table_name|upper }} {
{% for col in table.columns %}        {{ col.data_type|replace(' ', '_') }} {{ col.column_name }}{% if col.column_name in table.primary_keys %} PK{% endif %}
{% endfor %}    }
{% endfor %}
{% for table in schema_info %}
{% for fk in table.foreign_keys %}
    {{ table.table_name|upper }} }|--|| {{ fk.foreign_table_name|upper }} : "{{ fk.column_name }}"
{% endfor %}
{% endfor %}
            

SQL Query Explorer

Run SELECT queries on your data. Queries are automatically scoped to your user account for security.

Tables Overview

{% for table in schema_info %}

{{ table.table_name }}

{{ table.columns|length }} column{{ 's' if table.columns|length != 1 else '' }} {% if table.primary_keys %}ยท {{ table.primary_keys|length }} PK{% endif %}

{% for col in table.columns %}
{% if col.column_name in table.primary_keys %} {% else %} {% endif %}
{{ col.column_name }} {{ col.data_type }} {% if col.is_nullable == 'NO' %}*{% endif %}
{% endfor %}
{% if table.foreign_keys %}

References:

{% for fk in table.foreign_keys %}
{{ fk.foreign_table_name }} ({{ fk.column_name }})
{% endfor %}
{% endif %}
{% endfor %}
{% endblock %}