Release 3.0.0
Release 3.0.0
This is a major release of Doctrine DBAL that focuses on API improvements and removal of deprecated APIs.
Major release highlights
- Integration with PDO has been reworked. The
php_pdo
extension is no longer a hard dependency of thedoctrine/dbal
package. The PDO API is not longer the standard for DBAL APIs. - The wrapper-level connection and statement classes no longer implement the corresponding driver-level interfaces.
- Instead of being available in certain states of the
Statement
class, the statement result is explicitly returned as a separate value. - A new dedicated API has been introduced for unique constraints.
- The prepared statement portability layer has been reworked on top of the newly introduced Driver Middleware API.
- The logic of conversion of driver-specific error codes and exceptions has been extracted into the Exception Converter API.
- The SQL parser has been completely reworked to allow for better compatibility with the SQL syntax.
- The following database platforms are no longer supported:
- Drizzle,
- MariaDB 10.0 and older,
- Microsoft Azure,
- PostgreSQL 9.3 and older,
- SQL Anywhere,
- SQL Server 2008 and older.
- The following drivers are no longer supported:
pdo_ibm
,sasql
.
- Passing a PDO instance initialized outside of the DBAL is no longer supported.
- The support for UUID generation on the database side has been dropped.
- The
MasterSlaveConnection
class has been renamed toPrimaryReplicaConnection
. - The
executeUpdate()
method has been renamed toexecuteStatement()
. - All driver classes and driver-level connection and statement classes are now consistently named and declared as
final
. - All PDO-based drivers have been moved under the
PDO
namespace. - The
Doctrine\DBAL\DBALException
andDoctrine\DBAL\Driver\DriverException
have been renamed toDoctrine\DBAL\Exception
andDoctrine\DBAL\Driver\Exception
respectively.
- Total issues resolved: 26
- Total pull requests resolved: 99
- Total contributors: 13
PHP 8 support
- 4207: Update locked composer/package-versions-deprecated for compatibility with PHP 8.0 thanks to @morozov
- 4203: Remove --ignore-platform-reqs from PHP 8.0 builds thanks to @morozov
- 4197: The test suite fails on PHP 8 due to introduction of the match keyword thanks to @morozov
- 4171: Inconsistent naming of method arguments thanks to @morozov
- 4028: Allow php 8 thanks to @greg0ire
- 3814: Added builds against PHP nightly on Travis thanks to @morozov
- 3802: OCI8StatementTest fails on PHP 8 thanks to @morozov
API improvements
- 4429: Throw exception on invalid LockMode thanks to @morozov and @BenMorel
- 4397: Port the SQL parser from PDO thanks to @morozov and @shurik005
- 4317: Reintroduce parts of Legacy API for some more time thanks to @beberlei
- 4293: Add Result::fetchAllKeyValue() and ::iterateKeyValue() thanks to @morozov
- 4159: Do not implement driver-level interfaces by wrapper-level classes thanks to @morozov
- 4157: Rework the portability layer to act as a middleware thanks to @morozov
- 4149: Replace DefaultExceptionConverter with driver-specific implementations thanks to @morozov
- 4136: Move the logic of driver exception conversion into a separate interface thanks to @morozov
- 4129: Remove ExceptionConverterDriver thanks to @morozov
- 4081: Simplify Driver::connect() signature thanks to @morozov
- 4045: Extract Result from the Statement interface thanks to @morozov
- 4035: Moved rowCount() from Statement to ResultStatement thanks to @morozov
- 4007: Replace the concept of statement fetch modes with the explicit API thanks to @morozov
- 4039: Refactor portability statement into a functional composition thanks to @morozov
- 3980: Segregated support of unique index and unique constraint thanks to @guilhermeblanco
- 3943: Do not require hostname for non-persistent MySQL connection and require for persistent thanks to @morozov
- 3548: Remove user provided PDO functionality thanks to @morozov
- 3080: [DBAL-3079] Reworked the usage of PDO in PDOConnection from inheritance to composition thanks to @morozov
- 2958: Remove hard dependency on PDO thanks to @morozov
Legacy platform and driver removal
- 4077: Remove SQL Anywhere platform and driver thanks to @morozov
- 3756: Dropped SQL Server 2008 support thanks to @morozov
- 3602: Remove support for sharding and the Azure platform thanks to @morozov
- 3584: Remove LoggerChain::addLogger thanks to @ostrolucky
- 3477: Drop db support for PostgreSQL 9.3 and MariaDB 10.0 thanks to @SenseException
- 3055: Drop support for legacy platforms thanks to @Majkl578 and @morozov
- 3040: Drop Drizzle support thanks to @BenMorel
Deprecated API removal
- 4294: Remove Abstraction\Result thanks to @morozov
- 4278: Remove deprecated APIs thanks to @morozov
- 4234: Remove deprecated APIs thanks to @morozov
- 4217: Remove the Synchronizer package thanks to @morozov
- 4167: Remove deprecated methods from the wrapper Connection thanks to @morozov
- 4153: Remove deprecated components thanks to @morozov
- 4128: Remove PingableConnection thanks to @morozov
- 4125: Remove deprecated driver classes thanks to @morozov
- 4115: Remove ServerInfoAwareConnection#requiresQueryForServerVersion() as an implementation detail thanks to @morozov
- 4113: Remove DriverException::getErrorCode() thanks to @morozov
- 4083: Remove MasterSlaveConnection thanks to @greg0ire
- 4082: Backport removal of deprecated APIs from develop thanks to @morozov
- 4064: Remove platform-specific portability mode constants thanks to @morozov
- 4059: Remove deprecations for ConnectionHelper thanks to @dmaicher
- 4030: Backport removal of some deprecated APIs thanks to @morozov
- 3934: Removed EchoSQLLogger thanks to @morozov
- 3808: Removed the OCI8Connection::getExecuteMode() method thanks to @morozov
- 3606: Removed Driver::getDatabase() in favor of Connection::getDatabase() thanks to @morozov
- 3579: Remove deprecated stuff for 3.0 thanks to @jwage
- 3553: Removed Driver::getName() thanks to @morozov
- 3518: Remove @deprecated stuff thanks to @Majkl578
- 3257: Remove Doctrine\DBAL\Types\Type::__toString() thanks to @Majkl578
- 3211: Removed support for DB-generated UUIDs thanks to @morozov
- 3070: Dropped support of fetching objects and non-zero column thanks to @morozov
- 2967: Drop Doctrine\DBAL\Version in favor of Ocramius\PackageVersions thanks to @Majkl578
Other breaking changes
- 4147: Mark driver classes final thanks to @morozov
- 4146: Require $platform in AbstractSchemaManager::__construct() thanks to @morozov
- 4138: PDO connection and statement classes made final thanks to @morozov
- 4109: Preparation to marking OCI8 driver classes final thanks to @morozov
- 4090: Make the $database argument of OracleSchemaManager::createDatabase() mandatory thanks to @morozov
- 3820: Made the OCI8Statement class final thanks to @morozov
- 3803: Backport PDO-related changes from master to 3.0.x thanks to @morozov
- 3750: VersionAwarePlatformDriver now extends Driver thanks to @morozov
Error handling
- 4387: Store query params in driver exceptions thanks to @BenMorel
- 4320: Properly format scalar values in ConversionException thanks to @morozov
- 4401: Add missing instanceof check thanks to @BenMorel
- 4160: Add some missing @throws annotations and fix thrown exceptions thanks to @morozov
- 4130: Missing driver exception annotations thanks to @morozov
- 4093: Expect only DriverException from Result::fetch*() methods thanks to @morozov
Documentation
- 4423: Add missing word thanks to @greg0ire
- 4384: Proofread upgrade guide thanks to @greg0ire
- 4164: Update architecture documentation thanks to @morozov
- 4135: Remove irrelevant references to PDO from the documentation thanks to @morozov
Test suite
- 4089: Remove the CommentedType class from tests thanks to @morozov
- 4058: Add tests for fetch*() methods of Portability\Result thanks to @morozov
- 4006: Fix logging in functional tests in case of connection failure thanks to @morozov
- 3965: Sync expected coverage report count thanks to @greg0ire
Other changes
- 4433: Require positional statement parameters to be a list thanks to @morozov
- 4431: Use individual properties in Configuration thanks to @BenMorel
- 4422: QueryBuilder must use 0-based positional parameter keys thanks to @morozov
- 4410: Remove support for colon prefix in statement parameters thanks to @morozov
- 4343: Rename MySql... to MySQL... and PostgreSqlSchemaManager to PostgreSQLSchemaManager thanks to @mvorisek
- 4323: Clean up redundant implements thanks to @BenMorel
- 4301: Remove irrelevant deprecation message from console runner thanks to @morozov
- 4290: Don't ignore empty strings in QueryBuilder thanks to @BenMorel
- 4140: Mark result constructors internal thanks to @morozov
- 4107: Remove the suppressed errors that PHPStan no longer reports thanks to @morozov
- 4091: Get rid of the call to Connection::getParams() in Portability\Statement thanks to @morozov
- 4084: Allow using on PHP 7.3 with Composer 2 thanks to @nicolas-grekas
- 4040: Merge up mistakes thanks to @greg0ire
- 3933: Removed the hard-coded MySQL default port and the usage of ini-settings thanks to @morozov
- 3932: Enable PHPStan strict rules thanks to @morozov
- 3915: Flatten source and test directory structure thanks to @morozov
- 3912: Made some platform class names reflect the lowest server version they support thanks to @morozov
- 3906: Backport removal of legacy platforms and drivers from master thanks to @morozov
- 3899: Drop support for PHP 7.2 in DBAL 3.0 thanks to @morozov
- 3862: Specify the platform configuration in composer.json thanks to @morozov
- 3860: Drop Doctrine\DBAL\Version in favor of Ocramius\PackageVersions thanks to @Majkl578
- 3847: Update Doctrine Coding Standard to 7.0 thanks to @morozov
- 3817: Refactored MySQLiStatement::$columnNames thanks to @morozov
- 3594: Removed some unused code bits thanks to @morozov