{% extends "base.html" %} {% block title %}{{ table.name }} — Table detail{% endblock %} {% block head_extra %} {% endblock %} {% block content %} {# Back link — prefer the first parent package, fall back to /catalog. #} ← Back to {% if parent_packages %}{{ parent_packages[0].name }}{% else %}catalog{% endif %} {# ── Hero card ─────────────────────────────────────────────── #} {% set _qmode = (table.query_mode or 'local')|lower %} {% set _glyph_bg = table.color or '#0073D1' %} {% set _initials = (table.name or table.id or '?').split()|map('first')|join('')|upper %}
{% if table.icon %}{{ table.icon }}{% else %}{{ _initials[:2] }}{% endif %}

{{ table.name }} {{ table.id }}

{% if table.description %}

{{ table.description }}

{% endif %}
{{ _qmode }} {# Skip the source-type pill when it's redundant with the mode pill — internal tables have source_type == query_mode == 'internal' and rendering two identical pills is visual noise. #} {% if table.source_type and table.source_type|lower != _qmode %} {{ table.source_type }} {% endif %} {# Qualified-name code chip — only useful for sources that round-trip to an upstream system (Keboola bucket.table, BigQuery dataset.table). Internal tables have no meaningful upstream qualified name. #} {% if table.bucket and table.source_type|lower != 'internal' %} · {{ table.bucket }}{% if table.source_table %}.{{ table.source_table }}{% endif %} {% endif %} {% if rows_display %} · {{ rows_display }} rows {% endif %} {% if size_display %} · {{ size_display }} {% endif %} {% if last_sync_display %} · Last sync {{ last_sync_display }} {% endif %}
{% if parent_packages %}
In package{{ '' if parent_packages|length == 1 else 's' }}: {% for p in parent_packages %} {{ p.name }}{% if not loop.last %}, {% endif %} {% endfor %}
{% endif %}
{# ── Sample questions ───────────────────────────────────────── #}

Sample questions you can ask

{% if user.is_admin %} {% endif %}
{% if sample_questions %} {% else %}

No sample questions seeded yet. {% if user.is_admin %}Click + Add to seed some.{% endif %}

{% endif %} {% if user.is_admin %}
One question per line. Saved as a JSON array of strings.
{% endif %}
{# ── Columns / What's inside ─────────────────────────────────── #}

What's inside

{% if columns %} {{ columns|length }} columns {% endif %}
{% if columns %} {% for c in columns %} {% endfor %}
ColumnTypeNullable
{{ c.name }} {{ c.type or '—' }} {{ 'yes' if c.nullable else 'no' }}
{% else %}

{% if table.source_type|lower == 'internal' %} No column profile cached yet — Agnes internal tables are populated by the server itself; columns surface once the table accumulates its first rows. {% else %} No column profile available yet. Run a sync to populate the column list, types, and nullability. {% endif %}

{# Trigger sync only makes sense for non-internal tables — internal ones are server-managed (no upstream to pull from). #} {% if user.is_admin and table.source_type|lower != 'internal' %}
{% endif %} {% endif %}
{# ── Things to know ─────────────────────────────────────────── #}

Things to know

{% if user.is_admin %} {% endif %}
{% if things_to_know %}
{{ things_to_know }}
{% else %}

No caveats or join hints recorded yet. {% if user.is_admin %}Click + Add to record some.{% endif %}

{% endif %} {% if user.is_admin %}
{% endif %}
{# ── Pairs well with ───────────────────────────────────────── #}

Pairs well with

{% if user.is_admin %} {% endif %}
{% if pairs_well_with %}
{% for p in pairs_well_with %} {{ p.name }} {% endfor %}
{% else %}

No related tables suggested yet. {% if user.is_admin %}Click + Add to link some.{% endif %}

{% endif %} {% if user.is_admin %}
Comma-separated table_registry.id values. Unknown ids are silently dropped on render.
{% endif %}
{% if user.is_admin %} {% endif %} {% endblock %}