{% block toolbar %} {% set icon %} {% set status = collector.querycount > 50 ? 'yellow' %} {{ include('@webprofiler/Icon/002--database.svg') }} {{ collector.querycount }} in {{ '%0.2f'|format(collector.time) }} ms {% endset %} {% set text %}
{{ 'Db queries'|t }} {{ collector.querycount }}
{{ 'Query time'|t }} {{ '%0.2f'|format(collector.time) }} ms
{{ 'Default database'|t }} {{ collector.database.driver }}://{{ collector.database.host }}:{{ collector.database.port }}/{{ collector.database.database }}
{% endset %} {{ include('@webprofiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: status|default('') }) }} {% endblock %} {% block panel %}

{{ 'You can export all data in CSV format using Drush: %command'|t({'%command': 'drush webprofiler:export-database-data ' ~ token ~ ' '}) }}

{% if collector.queries|length > collector.getQueryDetailedOutputThreshold %}

{{ 'More than %query queries detected, disable the detailed output.'|t({'%query': collector.getQueryDetailedOutputThreshold}) }}

{% else %} {{ attach_library('webprofiler/database')}} {% set queryHighlightThreshold = collector.queryHighlightThreshold %} {% for query in collector.queries %} {{ _self.query(query, token, loop.index0, queryHighlightThreshold) }} {% endfor %} {% endif %} {% endblock %} {% macro query(query, token, qid, queryHighlightThreshold) %} {% set slow_query = query.time > (queryHighlightThreshold/10) %}
      {{ query(query.query)|raw }}
      {% if query.args %}{% endif %}
    
Time Caller Database Target
{{ query.time }} ms {% if query.caller.class is not null %}{{ query.caller.class|lower }}{% endif %} {{ query.database }} {{ query.target }}
{% if query.args %}{{ 'Swap placeholders'|t }}{% endif %} {{ 'Copy query'|t }} {% if query_type(query.query) == 'SELECT' %}{{ 'Explain'|t }}{% endif %}
{% endmacro %}