Remove Connection::exec() and Connection::executeUpdate()

parent 684b4b53
......@@ -5,6 +5,8 @@
The following methods of the `Connection` class have been removed:
1. `query()`.
2. `exec()`.
3. `executeUpdate()`.
## BC BREAK: Changes in the wrapper-level API ancestry
......@@ -56,7 +58,6 @@ The following classes have been renamed:
The following driver-level methods are allowed to throw a Driver\Exception:
- `Connection::prepare()`
- `Connection::exec()`
- `Connection::lastInsertId()`
- `Connection::beginTransaction()`
- `Connection::commit()`
......
......@@ -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.
*
......
......@@ -27,7 +27,7 @@ use function count;
*
* 1. Replica if primary was never picked before and ONLY if 'getWrappedConnection'
* or 'executeQuery' is used.
* 2. Primary picked when 'exec', 'executeUpdate', 'executeStatement', 'insert', 'delete', 'update', 'createSavepoint',
* 2. Primary picked when 'executeStatement', 'insert', 'delete', 'update', 'createSavepoint',
* '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.
* 4. One replica connection is randomly picked ONCE during a request.
......@@ -256,18 +256,6 @@ class PrimaryReadReplicaConnection extends Connection
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}
*/
......
......@@ -174,12 +174,6 @@ class ConnectionTest extends TestCase
*/
public static function getQueryMethods(): iterable
{
yield 'exec' => [
static function (Connection $connection, string $statement): void {
$connection->exec($statement);
},
];
yield 'executeQuery' => [
static function (Connection $connection, string $statement): void {
$connection->executeQuery($statement);
......
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