php bin/console dbal:run-sql
Executes arbitrary SQL directly from the command line.
Usage
dbal:run-sql [--connection CONNECTION] [--depth DEPTH] [--force-fetch] [--] <sql>
Arguments
sql The SQL statement to execute.
Options
--connection The named database connection
--depth Dumping depth of result set (deprecated).
--force-fetch Forces fetching the result.
Help
The dbal:run-sql command executes the given SQL query and
outputs the results:
php bin/console dbal:run-sql "SELECT * FROM users"