php bin/console doctrine:query:sql

Executes arbitrary SQL directly from the command line.

Usage

doctrine:query:sql [--depth DEPTH] [--connection [CONNECTION]] [--] <sql>

Arguments

sql   The SQL statement to execute. 

Options

      --depth        Dumping depth of result set. 
      --connection   The connection to use for this command 

Help

The doctrine:query:sql command executes the given SQL query and
outputs the results:

php bin/console doctrine:query:sql "SELECT * FROM users"