Release v2.10.0
This is a minor release of Doctrine DBAL that aggregates over 70 fixes and improvements developed by 25 contributors over the last year.
This release focuses on internal code quality improvement and deprecating the functionality identified for removal in the next major release.
Note that PHP 7.2 is now the minimum supported PHP version.
Backwards Compatibility Breaks
This release introduces a minor BC break. Default column values are no longer handled as SQL expressions. They are converted to SQL literals (e.g. escaped). The previous behavior was not portable and was never by design.
Clients must now specify default values in their initial form, not in the form of an SQL literal (e.g. escaped).
Before:
$column->setDefault('Foo\\\\Bar\\\\Baz');
After:
$column->setDefault('Foo\\Bar\\Baz');
Deprecations
- The usage of the
getDriver()
,getDatabasePlatform()
andgetSchemaManager()
methods of theConnectionEventArgs
class has been deprecated. - The usage of the
getDatabasePlatform()
method of theSchemaColumnDefinitionEventArgs
class has been deprecated. - The usage of the
getHost()
,getPort()
,getUsername()
andgetPassword()
methods of theConnection
class has been deprecated. - Passing multiple SQL statements as an array to
SchemaAlterTableAddColumnEventArgs::addSql()
and the same method in otherSchemaEventArgs
-based classes is deprecated. - Calling
AbstractSchemaManager::tablesExist()
with a string argument is deprecated. - Calling
OracleSchemaManager::createDatabase()
without an argument or by passingNULL
is deprecated. - Unused schema manager methods are deprecated.
AbstractSchemaManager::_getPortableFunctionsList()
,AbstractSchemaManager::_getPortableFunctionDefinition()
,OracleSchemaManager::_getPortableFunctionDefinition()
,SqliteSchemaManager::_getPortableTableIndexDefinition()
.
- The usage of
NULL
to indicate empty$username
or$password
when callingDoctrine\DBAL\Driver::connect()
is deprecated. - Method
Doctrine\DBAL\Platforms::_getAlterTableIndexForeignKeySQL()
has been deprecated as no longer used. - Property
Doctrine\DBAL\Driver\OCI8\OCI8Statement::$_PARAM
has been deprecated as not used. - Method
Doctrine\DBAL\Driver::getName()
is deprecated. - The usage of user-provided
PDO
instance is deprecated. Type::*
constants are deprecated.- The
Doctrine\DBAL\Driver\SQLSrv\SQLSrvStatement::LAST_INSERT_ID_SQL
constant has been deprecated. - The constants in
Doctrine\DBAL\SQLParserUtils
have been deprecated. - The
Doctrine\DBAL\Logging\LoggerChain::addLogger
method has been deprecated.
Please see the details in the UPGRADE.md documentation.
New Features and Improvements
- 3674: Add missing MySQL 8.0 reserved keywords thanks to @loilo
- 3512: Support for comments on table in all databases thanks to @moufmouf
- 3418: Add column charset for MySql thanks to @altertable
MySQL-related changes:
- 3668: Quote collation on MySQL thanks to @staudenmeir
- 3374: Clean up
MySqlPlatform::getListTableIndexesSQL()
fields thanks to @BenMorel - 3311: Ensuring correct
ALTER TABLE
statement for creation of anAUTO INCREMENT
column as newPRIMARY KEY
thanks to @arnegroskurth
Driver level changes:
- 3677: Relax statement type declaration thanks to @greg0ire
- 3521: Maintain platform parameter in connection params thanks to @jwage and @Perf
- 3588: Add commit result bool thanks to @otazniksk
Schema management:
Types improvements:
- 3356: Extract constants for built-in types from Type to Types thanks to @Majkl578
- 3354: Extract type factory and registry from Type into TypeRegistry thanks to @Majkl578
Compatibility with Symfony 5:
- 3706: add missing exit codes to ensure Symfony 5 compatibility thanks to @dmaicher
- 3563: Allow Symfony 5 thanks to @nicolas-grekas
Query Builder:
Logging:
Code quality improvements:
- 3667: Phpstan fix backport thanks to @morozov
- 3663: Updated PHPStan to v0.11.15 thanks to @morozov
- 3604: Updated Jetbrains PhpStorm stubs to 2019.1 thanks to @morozov
- 3549: Removed the assertion which doesn't work with a user-provided PDO connection thanks to @morozov
- 3489: Update doctrine coding standard from 5.0 to 6.0 thanks to @amaabdou
- 3481: Updated PHPStan to v0.11.3 thanks to @morozov
- 3443: PHPStan Level 7 thanks to @morozov
- 3442: PHPStan Level 6 thanks to @morozov
- 3436: PHPStan Level 5 thanks to @morozov
- 3435: PHPStan Level 4 thanks to @morozov
- 3432: Updated PHPStan to v0.11 thanks to @morozov
Test suite improvements:
- 3705: Don't skip a test for sqlite thanks to @Federkun
- 3689: Updated PHPUnit to 8.4.1 thanks to @morozov
- 3664: Refactor usage of MockBuilder's deprecated setMethods() thanks to @baspeeters
- 3643: Bumped PHPUnit requrement to ^8.3.3, removed dependency on symfony/phpunit-bridge thanks to @morozov
- 3609: Reworked the mocks generated by Prophecy using PHPUnit thanks to @morozov
- 3608: Added a unit test for Doctrine\DBAL\Logging\LoggerChain thanks to @morozov
- 3600: Updated PHPUnit to 8.2.1 thanks to @morozov
- 3575: Enforced parameter and return value types in test classes thanks to @morozov
- 3566: Upgraded to PHPUnit 8.1.6 and reworked the remaining driver exception mock thanks to @morozov
- 3555: Removed the rest of mock classes thanks to @morozov
- 3546: Reworked driver exception tests thanks to @morozov
- 3530: Improve ExceptionTest::testConnectionExceptionSqLite thanks to @jwage
- 3474: Remove more hard-coded mock classes thanks to @morozov
- 3470: Replaced MockPlatform with the ones generated by PHPUnit thanks to @morozov
- 3468: Marked some test classes abstract thanks to @morozov
- 3446: Upgraded PHPUnit to 8.0 thanks to @morozov
Documentation improvements:
- 3616: Fix typo in docblock thanks to @rdarcy1
- 3559: add .github/FUNDING.yml thanks to @jwage
- 3556: Removed 2.8 from README thanks to @morozov
- 3514: Expand list of keywords in composer.json thanks to @Majkl578
- 3504: fix #3479 (typos in example-code in QueryBuilder) thanks to @DavidBruchmann
- 3503: Fix the branch alias for master thanks to @stof
- 3463: fixed a typo in PoolingShardConnection phpdoc thanks to @adapik
- 3408: Removed unused build files thanks to @morozov
- 3404: Link to Slack instead of Gitter thanks to @greg0ire
- 3376: Bump version to 2.10.0-DEV thanks to @morozov
CI improvements:
- 3688: Temporarily disable the usage of PHPUnit 8.4 due to a regression thanks to @morozov
- 3654: fix Appveyor builds thanks to @mmucklo
- 3644: Using command line options to configure MySQL 8 instead of mounting a config file thanks to @morozov
- 3509: Enabled the build against IBM DB2 on PHP 7.3 on Travis CI thanks to @morozov
- 3528: Reworked SQL Server installer on Travis CI thanks to @morozov
- 3484: Use latest stable versions of sqlsrv and pdo_sqlsrv on CI thanks to @morozov
- 3475: Make PHP 7.3 the primary PHP version on Travis CI thanks to @morozov
- 3473: Avoid database connection from PHPUnit data providers thanks to @morozov
- 3469: Replaced Xdebug with PCOV for code coverage thanks to @morozov
- 3405: Travis CI: PHP 7.3 tests on MySQL 8.0 thanks to @BenMorel
- 3394: Grouped PHPStan and PHP_CodeSniffer for parallel execution thanks to @morozov
- 3388: Require PHP 7.2, drop <7.2 in Composer & on CI thanks to @morozov
- 3122: Introduced a smoke testing phase on Travis to run SQLite tests and CS checks first thanks to @morozov
Deprecations:
- 3708: New deprecations for 2.10 thanks to @morozov and @jwage
- 3598: Deprecated some unused code bits thanks to @morozov
- 3558: Deprecated Driver::getName() thanks to @morozov
- 3554: The usage of user-provided PDO instance is deprecated thanks to @morozov
- 3542: Deprecate SQLSrvStatement::LAST_INSERT_ID_SQL constant. thanks to @jwage
- 3541: Deprecate the public constants in SQLParserUtils thanks to @jwage