Commit 8d39f936 authored by Steve Müller's avatar Steve Müller

rename "fetch-result" option to "force-fetch" in RunSqlCommand

parent b346106c
......@@ -49,7 +49,7 @@ class RunSqlCommand extends Command
->setDefinition(array(
new InputArgument('sql', InputArgument::REQUIRED, 'The SQL statement to execute.'),
new InputOption('depth', null, InputOption::VALUE_REQUIRED, 'Dumping depth of result set.', 7),
new InputOption('fetch-result', null, InputOption::VALUE_NONE, 'Forces fetching the result.'),
new InputOption('force-fetch', null, InputOption::VALUE_NONE, 'Forces fetching the result.'),
))
->setHelp(<<<EOT
Executes arbitrary SQL directly from the command line.
......@@ -74,7 +74,7 @@ EOT
throw new \LogicException("Option 'depth' must contains an integer value");
}
if (stripos($sql, 'select') === 0 || $input->getOption('fetch-result')) {
if (stripos($sql, 'select') === 0 || $input->getOption('force-fetch')) {
$resultSet = $conn->fetchAll($sql);
} else {
$resultSet = $conn->executeUpdate($sql);
......
......@@ -114,7 +114,7 @@ class RunSqlCommandTest extends \PHPUnit_Framework_TestCase
$this->commandTester->execute(array(
'command' => $this->command->getName(),
'sql' => '"WITH bar as (SELECT 1) SELECT * FROM bar',
'--fetch-result' => true,
'--force-fetch' => true,
));
$this->assertRegExp('@int.*1.*@', $this->commandTester->getDisplay());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment