Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
8d39f936
Commit
8d39f936
authored
Jan 09, 2016
by
Steve Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename "fetch-result" option to "force-fetch" in RunSqlCommand
parent
b346106c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
RunSqlCommand.php
lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php
+2
-2
RunSqlCommandTest.php
...s/Doctrine/Tests/DBAL/Tools/Console/RunSqlCommandTest.php
+1
-1
No files found.
lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php
View file @
8d39f936
...
...
@@ -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
(
'f
etch-result
'
,
null
,
InputOption
::
VALUE_NONE
,
'Forces fetching the result.'
),
new
InputOption
(
'f
orce-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
(
'f
etch-result
'
))
{
if
(
stripos
(
$sql
,
'select'
)
===
0
||
$input
->
getOption
(
'f
orce-fetch
'
))
{
$resultSet
=
$conn
->
fetchAll
(
$sql
);
}
else
{
$resultSet
=
$conn
->
executeUpdate
(
$sql
);
...
...
tests/Doctrine/Tests/DBAL/Tools/Console/RunSqlCommandTest.php
View file @
8d39f936
...
...
@@ -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'
,
'--f
etch-result
'
=>
true
,
'--f
orce-fetch
'
=>
true
,
));
$this
->
assertRegExp
(
'@int.*1.*@'
,
$this
->
commandTester
->
getDisplay
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment