Skip to content

Commit

Permalink
Merge branch '3.0.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Mar 21, 2020
2 parents 01143c9 + 40cc9bd commit 7811e4e
Show file tree
Hide file tree
Showing 34 changed files with 168 additions and 172 deletions.
138 changes: 72 additions & 66 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,6 @@ The statement implementations no longer detect whether `$params` is a zero- or o

The `ServerInfoAwareConnection::requiresQueryForServerVersion()` method has been removed as an implementation detail which is the same for almost all supported drivers.

## BC BREAK: Removed support for PostgreSQL 9.3 and older

DBAL now requires PostgeSQL 9.4 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to newer PostgreSQL version (9.6+ is recommended).
`Doctrine\DBAL\Platforms\PostgreSqlPlatform` and `Doctrine\DBAL\Platforms\Keywords\PostgreSQLKeywords` now represent the PostgreSQL 9.4.

The following classes have been removed:

* `Doctrine\DBAL\Platforms\PostgreSQL94Platform`
* `Doctrine\DBAL\Platforms\Keywords\PostgreSQL94Keywords`

## BC BREAK: Removed support for MariaDB 10.0 and older

DBAL now requires MariaDB 10.1 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to newer MariaDB version (10.1+ is recommended).

## BC BREAK: Changes in obtaining the currently selected database name

- The `Doctrine\DBAL\Driver::getDatabase()` method has been removed. Please use `Doctrine\DBAL\Connection::getDatabase()` instead.
Expand Down Expand Up @@ -266,94 +250,94 @@ The `NULL` value of the `$offset` argument in `AbstractPlatform::(do)?ModifyLimi
The support for DB-generated UUIDs was removed as non-portable.
Please generate UUIDs on the application side (e.g. using [ramsey/uuid](https://packagist.org/packages/ramsey/uuid)).

## BC BREAK: Removed MsSQLKeywords class
## BC BREAK: Removed Doctrine\DBAL\Version

The `Doctrine\DBAL\Platforms\MsSQLKeywords` has been removed.
Please use `Doctrine\DBAL\Platforms\SQLServerPlatform `instead.
The Doctrine\DBAL\Version class is no longer available: please refrain from checking the DBAL version at runtime.

## BC BREAK: Removed PDO DB2 driver
## BC BREAK: SQLLogger changes

This PDO-based IBM DB2 driver (built on top of pdo_ibm extension) has already been unsupported as of 2.5, it has now been now removed.
- The `SQLLogger` interface has changed; the methods are the same but use scalar type hints, return types, and non-nullable arrays.
- `SQLLogger` implementations: `DebugStack`, `EchoSQLLogger`, `LoggerChain` are now final.
- `Configuration::getSQLLogger()` does not return `null` anymore, but a `NullLogger` implementation.
- `Configuration::setSQLLogger()` does not allow `null` anymore.

The following class has been removed:
## BC BREAK: Changes to handling binary fields

* `Doctrine\DBAL\Driver\PDOIbm\Driver`
- Binary fields whose length exceeds the maximum field size on a given platform are no longer represented as `BLOB`s.
Use binary fields of a size which fits all target platforms, or use blob explicitly instead.
- Binary fields are no longer represented as streams in PHP. They are represented as strings.

# Upgrade to 3.0

## BC BREAK: Removed support for SQL Anywhere 12 and older

DBAL now requires SQL Anywhere 16 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to newer SQL Anywhere version (16+).
`Doctrine\DBAL\Platforms\SQLAnywherePlatform` and `Doctrine\DBAL\Platforms\Keywords\SQLAnywhereKeywords` now represent the SQL Anywhere 16.
If you are using any of the legacy versions, you have to upgrade to a newer SQL Anywhere version (16+).

The following classes have been removed:

* `Doctrine\DBAL\Platforms\SQLAnywherePlatform`
* `Doctrine\DBAL\Platforms\SQLAnywhere11Platform`
* `Doctrine\DBAL\Platforms\SQLAnywhere12Platform`
* `Doctrine\DBAL\Platforms\SQLAnywhere16Platform`
* `Doctrine\DBAL\Platforms\Keywords\SQLAnywhereKeywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLAnywhere11Keywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLAnywhere12Keywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLAnywhere16Keywords`

## BC BREAK: Removed support for SQL Server 2008 and older

DBAL now requires SQL Server 2012 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to newer SQL Server version.
`Doctrine\DBAL\Platforms\SQLServerPlatform` and `Doctrine\DBAL\Platforms\Keywords\SQLServerKeywords` now represent the SQL Server 2012.

The following classes have been removed:

* `Doctrine\DBAL\Platforms\SQLServer2005Platform`
* `Doctrine\DBAL\Platforms\SQLServer2008Platform`
* `Doctrine\DBAL\Platforms\SQLServer2012Platform`
* `Doctrine\DBAL\Platforms\Keywords\SQLServer2005Keywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLServer2008Keywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLServer2012Keywords`

The `AbstractSQLServerDriver` class and its subclasses no longer implement the `VersionAwarePlatformDriver` interface.

## BC BREAK: Removed support for PostgreSQL 9.2 and older
## BC BREAK: Removed support for PostgreSQL 9.3 and older

DBAL now requires PostgeSQL 9.3 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to newer PostgreSQL version (9.6+ is recommended).
`Doctrine\DBAL\Platforms\PostgreSqlPlatform` and `Doctrine\DBAL\Platforms\Keywords\PostgreSQLKeywords` now represent the PostgreSQL 9.3.
DBAL now requires PostgreSQL 9.4 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to a newer PostgreSQL version (9.6+ is recommended).

The following classes have been removed:

* `Doctrine\DBAL\Platforms\PostgreSqlPlatform`
* `Doctrine\DBAL\Platforms\PostgreSQL91Platform`
* `Doctrine\DBAL\Platforms\PostgreSQL92Platform`
* `Doctrine\DBAL\Platforms\Keywords\PostgreSQLKeywords`
* `Doctrine\DBAL\Platforms\Keywords\PostgreSQL91Keywords`
* `Doctrine\DBAL\Platforms\Keywords\PostgreSQL92Keywords`

## BC BREAK: Removed Doctrine\DBAL\Version
## BC BREAK: Removed support for MariaDB 10.0 and older

The Doctrine\DBAL\Version class is no longer available: please refrain from checking the DBAL version at runtime.
DBAL now requires MariaDB 10.1 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to a newer MariaDB version (10.1+ is recommended).

## BC BREAK: Removed Drizzle support
## BC BREAK: PingableConnection and ServerInfoAwareConnection interfaces now extend Connection

The Drizzle project is abandoned and is therefore not supported by Doctrine DBAL anymore.
All implementations of the `PingableConnection` and `ServerInfoAwareConnection` interfaces have to implement the methods defined in the `Connection` interface as well.

## BC BREAK: SQLLogger changes
## BC BREAK: VersionAwarePlatformDriver interface now extends Driver

- The `SQLLogger` interface has changed; the methods are the same but use scalar type hints, return types, and non-nullable arrays.
- `SQLLogger` implementations: `DebugStack`, `EchoSQLLogger`, `LoggerChain` are now final.
- `Configuration::getSQLLogger()` does not return `null` anymore, but a `NullLogger` implementation.
- `Configuration::setSQLLogger()` does not allow `null` anymore.
All implementations of the `VersionAwarePlatformDriver` interface have to implement the methods defined in the `Driver` interface as well.

## BC BREAK: Changes to handling binary fields
## BC BREAK: Removed MsSQLKeywords class

- Binary fields whose length exceeds the maximum field size on a given platform are no longer represented as `BLOB`s.
Use binary fields of a size which fits all target platforms, or use blob explicitly instead.
- Binary fields are no longer represented as streams in PHP. They are represented as strings.
The `Doctrine\DBAL\Platforms\MsSQLKeywords` class has been removed.
Please use `Doctrine\DBAL\Platforms\SQLServerPlatform `instead.

# Upgrade to 3.0
## BC BREAK: Removed PDO DB2 driver

## BC BREAK: PingableConnection and ServerInfoAwareConnection interfaces now extend Connection
This PDO-based IBM DB2 driver (built on top of `pdo_ibm` extension) has already been unsupported as of 2.5, it has been now removed.

All implementations of the `PingableConnection` and `ServerInfoAwareConnection` interfaces have to implement the methods defined in the `Connection` interface as well.
The following class has been removed:

## BC BREAK: VersionAwarePlatformDriver interface now extends Driver
* `Doctrine\DBAL\Driver\PDOIbm\Driver`

All implementations of the `VersionAwarePlatformDriver` interface have to implement the methods defined in the `Driver` interface as well.
## BC BREAK: Removed support for SQL Server 2008 and older

DBAL now requires SQL Server 2012 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to a newer SQL Server version.

The following classes have been removed:

* `Doctrine\DBAL\Platforms\SQLServerPlatform`
* `Doctrine\DBAL\Platforms\SQLServer2005Platform`
* `Doctrine\DBAL\Platforms\SQLServer2008Platform`
* `Doctrine\DBAL\Platforms\Keywords\SQLServerKeywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLServer2005Keywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLServer2008Keywords`

The `AbstractSQLServerDriver` class and its subclasses no longer implement the `VersionAwarePlatformDriver` interface.

## BC BREAK: Removed Doctrine\DBAL\Version

Expand Down Expand Up @@ -396,6 +380,10 @@ After:
$stmt->bindValue(1, 1, ParameterType::INTEGER);
$stmt->fetchAll(FetchMode::COLUMN);

## BC BREAK: Removed Drizzle support

The Drizzle project is abandoned and is therefore not supported by Doctrine DBAL anymore.

## BC BREAK: Removed dbal:import CLI command

The `dbal:import` CLI command has been removed since it only worked with PDO-based drivers by relying on a non-documented behavior of the extension, and it was impossible to make it work with other drivers.
Expand All @@ -407,6 +395,24 @@ Please use other database client applications for import, e.g.:

# Upgrade to 2.11

## Deprecated database platforms:

1. PostgreSQL 9.3 and older
2. MariaDB 10.0 and older
3. SQL Server 2008 and older
4. SQL Anywhere 12 and older
5. Drizzle
6. Azure SQL Database

## Deprecated database drivers:

1. PDO-based IBM DB2 driver
2. Drizzle MySQL driver

## Deprecated `Doctrine\DBAL\Sharding` package

The sharding functionality in DBAL has been effectively unmaintained for a long time.

## Deprecated `Doctrine\DBAL\Version` class

The usage of the `Doctrine\DBAL\Version` class is deprecated as internal implementation detail. Please refrain from checking the DBAL version at runtime.
Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ You can also pass this option if you want to disable automatic database platform
detection for a driver that natively supports it and choose the platform version
implementation explicitly.

If you are running a MariaDB database, you should prefix the ``serverVersion``
If you are running a MariaDB database, you should prefix the ``serverVersion``
with ``mariadb-`` (ex: ``mariadb-10.2.12``).

Custom Platform
Expand Down
8 changes: 2 additions & 6 deletions docs/en/reference/platforms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,17 @@ Oracle
Microsoft SQL Server
^^^^^^^^^^^^^^^^^^^^

- ``SQLServerPlatform`` for version 2012 and above.
- ``SQLServer2012Platform`` for version 2012 and above.

PostgreSQL
^^^^^^^^^^

- ``PostgreSqlPlatform`` for version 9.4 and above.
- ``PostgreSQL94Platform`` for version 9.4 and above.
- ``PostgreSQL100Platform`` for version 10.0 and above.

SAP Sybase SQL Anywhere
^^^^^^^^^^^^^^^^^^^^^^^

- ``SQLAnywherePlatform`` for version 10 and above.
- ``SQLAnywhere11Platform`` for version 11 and above.
- ``SQLAnywhere12Platform`` for version 12 and above.
- ``SQLAnywhere16Platform`` for version 16 and above.

SQLite
Expand Down Expand Up @@ -103,4 +100,3 @@ all the different database vendors, for example MySQL BIGINT and
Oracle NUMBER should be handled as integer. Doctrine 2 offers a
powerful way to abstract the database to php and back conversion,
which is described in the next section.

6 changes: 3 additions & 3 deletions lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\Exception\InvalidPlatformVersion;
use Doctrine\DBAL\Platforms\PostgreSQL100Platform;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\PostgreSqlSchemaManager;
use Doctrine\DBAL\VersionAwarePlatformDriver;
Expand Down Expand Up @@ -98,12 +98,12 @@ public function createDatabasePlatformForVersion(string $version) : AbstractPlat
return new PostgreSQL100Platform();
}

return new PostgreSqlPlatform();
return new PostgreSQL94Platform();
}

public function getDatabasePlatform() : AbstractPlatform
{
return new PostgreSqlPlatform();
return new PostgreSQL94Platform();
}

public function getSchemaManager(Connection $conn) : AbstractSchemaManager
Expand Down
6 changes: 3 additions & 3 deletions lib/Doctrine/DBAL/Driver/AbstractSQLAnywhereDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Doctrine\DBAL\Exception\DriverException;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\Exception\InvalidPlatformVersion;
use Doctrine\DBAL\Platforms\SQLAnywherePlatform;
use Doctrine\DBAL\Platforms\SQLAnywhere16Platform;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\SQLAnywhereSchemaManager;
use Doctrine\DBAL\VersionAwarePlatformDriver;
Expand Down Expand Up @@ -89,12 +89,12 @@ public function createDatabasePlatformForVersion(string $version) : AbstractPlat
);
}

return new SQLAnywherePlatform();
return new SQLAnywhere16Platform();
}

public function getDatabasePlatform() : AbstractPlatform
{
return new SQLAnywherePlatform();
return new SQLAnywhere16Platform();
}

public function getSchemaManager(Connection $conn) : AbstractSchemaManager
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/DBAL/Driver/AbstractSQLServerDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\SQLServerPlatform;
use Doctrine\DBAL\Platforms\SQLServer2012Platform;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\SQLServerSchemaManager;

Expand All @@ -18,7 +18,7 @@ abstract class AbstractSQLServerDriver implements Driver
{
public function getDatabasePlatform() : AbstractPlatform
{
return new SQLServerPlatform();
return new SQLServer2012Platform();
}

public function getSchemaManager(Connection $conn) : AbstractSchemaManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* PostgreSQL 10.0 reserved keywords list.
*/
class PostgreSQL100Keywords extends PostgreSQLKeywords
class PostgreSQL100Keywords extends PostgreSQL94Keywords
{
public function getName() : string
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
namespace Doctrine\DBAL\Platforms\Keywords;

/**
* PostgreSQL keywords list.
* PostgreSQL 9.4 reserved keywords list.
*/
class PostgreSQLKeywords extends KeywordList
class PostgreSQL94Keywords extends KeywordList
{
public function getName() : string
{
return 'PostgreSQL';
return 'PostgreSQL94';
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
namespace Doctrine\DBAL\Platforms\Keywords;

/**
* SAP Sybase SQL Anywhere 10 reserved keywords list.
* SAP Sybase SQL Anywhere 16 reserved keywords list.
*/
class SQLAnywhereKeywords extends KeywordList
class SQLAnywhere16Keywords extends KeywordList
{
public function getName() : string
{
return 'SQLAnywhere';
return 'SQLAnywhere16';
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
namespace Doctrine\DBAL\Platforms\Keywords;

/**
* Microsoft SQL Server 2000 reserved keyword dictionary.
*
* @link www.doctrine-project.com
* Microsoft SQL Server 2012 reserved keyword dictionary.
*/
class SQLServerKeywords extends KeywordList
class SQLServer2012Keywords extends KeywordList
{
public function getName() : string
{
return 'SQLServer';
return 'SQLServer2012';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Platforms/PostgreSQL100Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Provides the behavior, features and SQL dialect of the PostgreSQL 10.0 database platform.
*/
class PostgreSQL100Platform extends PostgreSqlPlatform
class PostgreSQL100Platform extends PostgreSQL94Platform
{
protected function getReservedKeywordsClass() : string
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@

/**
* Provides the behavior, features and SQL dialect of the PostgreSQL 9.4+ database platform.
*
* @todo Rename: PostgreSQLPlatform
*/
class PostgreSqlPlatform extends AbstractPlatform
class PostgreSQL94Platform extends AbstractPlatform
{
/** @var bool */
private $useBooleanTrueFalseStrings = true;
Expand Down Expand Up @@ -1036,7 +1034,7 @@ public function hasNativeJsonType() : bool

protected function getReservedKeywordsClass() : string
{
return Keywords\PostgreSQLKeywords::class;
return Keywords\PostgreSQL94Keywords::class;
}

/**
Expand Down
Loading

0 comments on commit 7811e4e

Please sign in to comment.