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
ea020aa5
Unverified
Commit
ea020aa5
authored
Jul 10, 2020
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Connection::exec() and Connection::executeUpdate()
parent
684b4b53
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
45 deletions
+3
-45
UPGRADE.md
UPGRADE.md
+2
-1
Connection.php
src/Connection.php
+0
-25
PrimaryReadReplicaConnection.php
src/Connections/PrimaryReadReplicaConnection.php
+1
-13
ConnectionTest.php
tests/ConnectionTest.php
+0
-6
No files found.
UPGRADE.md
View file @
ea020aa5
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
The following methods of the
`Connection`
class have been removed:
The following methods of the
`Connection`
class have been removed:
1.
`query()`
.
1.
`query()`
.
2.
`exec()`
.
3.
`executeUpdate()`
.
## BC BREAK: Changes in the wrapper-level API ancestry
## BC BREAK: Changes in the wrapper-level API ancestry
...
@@ -56,7 +58,6 @@ The following classes have been renamed:
...
@@ -56,7 +58,6 @@ The following classes have been renamed:
The following driver-level methods are allowed to throw a Driver
\E
xception:
The following driver-level methods are allowed to throw a Driver
\E
xception:
-
`Connection::prepare()`
-
`Connection::prepare()`
-
`Connection::exec()`
-
`Connection::lastInsertId()`
-
`Connection::lastInsertId()`
-
`Connection::beginTransaction()`
-
`Connection::beginTransaction()`
-
`Connection::commit()`
-
`Connection::commit()`
...
...
src/Connection.php
View file @
ea020aa5
...
@@ -1083,31 +1083,6 @@ class Connection
...
@@ -1083,31 +1083,6 @@ class Connection
}
}
}
}
/**
* @deprecated Use {@link executeStatement()} instead.
*
* @throws DBALException
*/
public
function
exec
(
string
$statement
)
:
int
{
$connection
=
$this
->
getWrappedConnection
();
$logger
=
$this
->
_config
->
getSQLLogger
();
if
(
$logger
!==
null
)
{
$logger
->
startQuery
(
$statement
);
}
try
{
return
$connection
->
exec
(
$statement
);
}
catch
(
DriverException
$e
)
{
throw
$this
->
convertExceptionDuringQuery
(
$e
,
$statement
);
}
finally
{
if
(
$logger
!==
null
)
{
$logger
->
stopQuery
();
}
}
}
/**
/**
* Returns the current transaction nesting level.
* Returns the current transaction nesting level.
*
*
...
...
src/Connections/PrimaryReadReplicaConnection.php
View file @
ea020aa5
...
@@ -27,7 +27,7 @@ use function count;
...
@@ -27,7 +27,7 @@ use function count;
*
*
* 1. Replica if primary was never picked before and ONLY if 'getWrappedConnection'
* 1. Replica if primary was never picked before and ONLY if 'getWrappedConnection'
* or 'executeQuery' is used.
* or 'executeQuery' is used.
* 2. Primary picked when 'exec
', 'executeUpdate', 'exec
uteStatement', 'insert', 'delete', 'update', 'createSavepoint',
* 2. Primary picked when 'executeStatement', 'insert', 'delete', 'update', 'createSavepoint',
* 'releaseSavepoint', 'beginTransaction', 'rollback', 'commit' or 'prepare' is called.
* 'releaseSavepoint', 'beginTransaction', 'rollback', 'commit' or 'prepare' is called.
* 3. If Primary was picked once during the lifetime of the connection it will always get picked afterwards.
* 3. If Primary was picked once during the lifetime of the connection it will always get picked afterwards.
* 4. One replica connection is randomly picked ONCE during a request.
* 4. One replica connection is randomly picked ONCE during a request.
...
@@ -256,18 +256,6 @@ class PrimaryReadReplicaConnection extends Connection
...
@@ -256,18 +256,6 @@ class PrimaryReadReplicaConnection extends Connection
return
$config
;
return
$config
;
}
}
/**
* {@inheritDoc}
*
* @deprecated Use {@link executeStatement()} instead.
*/
public
function
executeUpdate
(
string
$query
,
array
$params
=
[],
array
$types
=
[])
:
int
{
$this
->
ensureConnectedToPrimary
();
return
parent
::
executeUpdate
(
$query
,
$params
,
$types
);
}
/**
/**
* {@inheritDoc}
* {@inheritDoc}
*/
*/
...
...
tests/ConnectionTest.php
View file @
ea020aa5
...
@@ -174,12 +174,6 @@ class ConnectionTest extends TestCase
...
@@ -174,12 +174,6 @@ class ConnectionTest extends TestCase
*/
*/
public
static
function
getQueryMethods
()
:
iterable
public
static
function
getQueryMethods
()
:
iterable
{
{
yield
'exec'
=>
[
static
function
(
Connection
$connection
,
string
$statement
)
:
void
{
$connection
->
exec
(
$statement
);
},
];
yield
'executeQuery'
=>
[
yield
'executeQuery'
=>
[
static
function
(
Connection
$connection
,
string
$statement
)
:
void
{
static
function
(
Connection
$connection
,
string
$statement
)
:
void
{
$connection
->
executeQuery
(
$statement
);
$connection
->
executeQuery
(
$statement
);
...
...
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