Symfony – Doctrine – How to see where a sql query is executed

When using Doctrine, it is sometimes important to find where a SQL query is executed.

To do this, simply activate the following option in the doctrine configuration

doctrine:
    dbal:
        default_connection: default

# A collection of custom types
        Types:
            # example
            some_custom_type:
                class: AcmeHelloBundleMyCustomType

Connections:
            # A collection of different named connections (e.g. default, conn2, etc.)
            default:
                dbname: ~
                host: localhost
                port:~
                user: root
                Password:~
                profiling_collect_backtrace: true
Publicités

See the doctrine configuration here

Once it is, in the profiler, the stack will be present

Publicités

Leave a Reply