Merge pull request #1230 from johannes/master
Allow dumping SQL query when passing DQL on cli
This commit is contained in:
commit
ef65270387
@ -64,6 +64,10 @@ class RunDqlCommand extends Command
|
||||
new InputOption(
|
||||
'depth', null, InputOption::VALUE_REQUIRED,
|
||||
'Dumping depth of Entity graph.', 7
|
||||
),
|
||||
new InputOption(
|
||||
'show-sql', null, InputOption::VALUE_NONE,
|
||||
'Dump generated SQL instead of executing query'
|
||||
)
|
||||
))
|
||||
->setHelp(<<<EOT
|
||||
@ -116,6 +120,11 @@ EOT
|
||||
$query->setMaxResults((int) $maxResult);
|
||||
}
|
||||
|
||||
if ($input->hasOption('show-sql')) {
|
||||
Debug::dump($query->getSQL());
|
||||
return;
|
||||
}
|
||||
|
||||
$resultSet = $query->execute(array(), constant($hydrationMode));
|
||||
|
||||
Debug::dump($resultSet, $input->getOption('depth'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user