Skip to content

Commit

Permalink
Prepare 2.0 stable release
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean85 committed Jun 8, 2023
1 parent f0114b6 commit 336b267
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 4 deletions.
76 changes: 76 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,82 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
* ...

## [2.0.0] - 2023-06-08
This is the final, stable release of the new version of this library, supporting DBAL 3.6+; unfortunately, DBAL 3.0 to 3.5 is unsupported (but upgrading to 3.6 should not be an issue).

If you're upgrading from a 1.x version, please refer to the [UPGRADE-2.0.md](./UPGRADE-2.0.md) document.

The version has no changes from 2.0.0-BETA4; the following is the detailed changelog from the 1.x series:

### Added
* Support DBAL v3.6+
* Add `GoneAwayDetector` interface and `MySQLGoneAwayDetector` class implementation
* Add `setGoneAwayDetector` method to the connections
* Add handling of AWS MySQL RDS connection loss
* Add validation to `x_reconnect_attempts`
* Add mutation testing with Infection

### Changed
* Change `Connection` method signatures to follow [DBAL v3 changes](https://github.com/doctrine/dbal/blob/3.3.x/UPGRADE.md#upgrade-to-30):

```diff
namespace Facile\DoctrineMySQLComeBack\Doctrine\DBAL;

use Doctrine\DBAL\Cache\QueryCacheProfile;
use Doctrine\DBAL\Connection as DBALConnection;
+use Doctrine\DBAL\Result;

class Connection extends DBALConnection
{
// ...
- public function prepare($sql)
+ public function prepare(string $sql): DBALStatement
// ...
- public function executeQuery($query, array $params = array(), $types = array(), QueryCacheProfile $qcp = null)
+ public function executeQuery(string $sql, array $params = [], $types = [], ?QueryCacheProfile $qcp = null): Result
// ...
}
```
* Change `Statement` constructor and method signatures to follow [DBAL v3 changes](https://github.com/doctrine/dbal/blob/3.3.x/UPGRADE.md#upgrade-to-30):
```diff
namespace Facile\DoctrineMySQLComeBack\Doctrine\DBAL;

use Doctrine\DBAL\Cache\QueryCacheProfile;
use Doctrine\DBAL\Connection as DBALConnection;
+use Doctrine\DBAL\Result;

class Statement extends \Doctrine\DBAL\Statement
{
// ...
- public function __construct($sql, ConnectionInterface $conn)
+ public function __construct(Connection $retriableConnection, Driver\Statement $statement, string $sql)
// ...
- public function executeQuery($query, array $params = array(), $types = array(), QueryCacheProfile $qcp = null)
+ public function executeQuery(string $sql, array $params = [], $types = [], ?QueryCacheProfile $qcp = null): Result
// ...
}
```

### Fixed
* In `PrimaryReadReplicaConnection`, fetch `driverOptions` from under the `primary` key

### Removed
* Drop support for DBAL v2
* Drop support for PHP 7.3
* Removed `Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Connections\MasterSlaveConnection` class
* Removed `Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\ServerGoneAwayExceptionsAwareInterface` interface
* Removed `Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\ServerGoneAwayExceptionsAwareTrait` trait
* Removed `Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\Mysqli\Driver` class
* Removed `Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\PDOMySQL\Driver` class
* Removed `Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\PDO\MySQL\Driver` class
* Removed `Connection::query()` method (due to drop in DBAL v3)
* Removed `Connection::refresh()` method (due to drop in DBAL v3)
* Removed `Connection::isUpdateQuery()` method (logic is now behind the `GoneAwayDetector` interface)
* Removed `Statement::bindValue()` method
* Removed `Statement::bindParam()` method
* Removed `Statement::execute()` method
* Removed `Statement::setFetchMode()` method

## [2.0.0-BETA4] - 2023-04-05
### Added
* Centralize reconnect attempts counter
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Auto reconnect on Doctrine MySql has gone away exceptions on `doctrine/dbal`.

# Installation

If you're using DBAL 3
If you're using DBAL 3.6+
```console
$ composer require facile-it/doctrine-mysql-come-back ^2.0
```
Expand Down
8 changes: 5 additions & 3 deletions UPGRADE-2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ If you were instead extending the code inside this library, you should proceed w
* Support DBAL v3.6+
* Add `GoneAwayDetector` interface and `MySQLGoneAwayDetector` class implementation
* Add `setGoneAwayDetector` method to the connections
* Added handling of AWS MySQL RDS connection loss
* Add handling of AWS MySQL RDS connection loss
* Add validation to `x_reconnect_attempts`
* Add mutation testing with Infection

### Changed
* Changed `Connection` method signatures to follow [DBAL v3 changes](https://github.com/doctrine/dbal/blob/3.3.x/UPGRADE.md#upgrade-to-30):
* Change `Connection` method signatures to follow [DBAL v3 changes](https://github.com/doctrine/dbal/blob/3.3.x/UPGRADE.md#upgrade-to-30):

```diff
namespace Facile\DoctrineMySQLComeBack\Doctrine\DBAL;
Expand All @@ -37,7 +38,7 @@ class Connection extends DBALConnection
// ...
}
```
* Changed `Statement` constructor and method signatures to follow [DBAL v3 changes](https://github.com/doctrine/dbal/blob/3.3.x/UPGRADE.md#upgrade-to-30):
* Change `Statement` constructor and method signatures to follow [DBAL v3 changes](https://github.com/doctrine/dbal/blob/3.3.x/UPGRADE.md#upgrade-to-30):
```diff
namespace Facile\DoctrineMySQLComeBack\Doctrine\DBAL;

Expand All @@ -62,6 +63,7 @@ class Statement extends \Doctrine\DBAL\Statement

### Removed
* Drop support for DBAL v2
* Drop support for PHP 7.3
* Removed `Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Connections\MasterSlaveConnection` class
* Removed `Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\ServerGoneAwayExceptionsAwareInterface` interface
* Removed `Facile\DoctrineMySQLComeBack\Doctrine\DBAL\Driver\ServerGoneAwayExceptionsAwareTrait` trait
Expand Down
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
],
"license": "Apache-2.0",
"authors": [
{
"name": "Alessandro Lai",
"email": "[email protected]"
},
{
"name": "Luca Bo",
"email": "[email protected]"
Expand Down

0 comments on commit 336b267

Please sign in to comment.