{% extends 'base.html.twig' %} {% import '_sidebar_tables.html.twig' as macros %} {% block title %}{{ tableName }} — Query · Jormun Admin{% endblock %} {% block breadcrumbs %} Home / {{ tableName }} / Query {% endblock %} {% block sidebar_tables %} {{ macros.sidebar_table_links(tables, tableName) }} {% endblock %} {% block content %}
{# Builder form #}
Query Builder
{# Mode toggle #}
{# Conditions (only for Query mode) #}
Key Conditions
PK: {{ keySchema.HASH.name ?? '?' }} {% if keySchema.RANGE is defined %} SK: {{ keySchema.RANGE.name }} {% endif %}
{# Results #}
{% if error %}
{{ error }}
{% endif %} {% if results is not null %}
Results
{{ results|length }} item{{ results|length != 1 ? 's' : '' }}
{% if results is empty %}
No items matched your query.
{% else %} {# Collect columns #} {% set cols = {} %} {% for item in results %}{% for k in item|keys %}{% set cols = cols|merge({(k): true}) %}{% endfor %}{% endfor %}
{% for col in cols|keys %} {% endfor %} {% for item in results %} {% for col in cols|keys %} {% endfor %} {% endfor %}
{{ col }} {% if keySchema.HASH is defined and keySchema.HASH.name == col %} PK {% endif %} {% if keySchema.RANGE is defined and keySchema.RANGE.name == col %} SK {% endif %}
{% if item[col] is defined %} {% set val = item[col] %} {% if val is iterable %} {{ val|json_encode|slice(0, 50) }}{% if val|json_encode|length > 50 %}…{% endif %} {% else %} {{ val|e|slice(0, 60) }}{% if (val|e|length) > 60 %}…{% endif %} {% endif %} {% else %} NULL {% endif %}
{% endif %}
{% else %}
Build a query
Set conditions on the left and click Run Query, or use Scan for all items.
{% endif %}
{% endblock %} {% block scripts %} {% endblock %}