Skip to content

Deprecate fallback connection to determine platform #5707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ awareness about deprecated code.

# Upgrade to 3.5

## Deprecated fallback connection used to determine the database platform.

Relying on a fallback connection used to determine the database platform while connecting to a non-existing database
has been deprecated. Either use an existing database name in connection parameters or omit the database name
if the platform and the server configuration allow that.

## Deprecated default PostgreSQL connection database.

Relying on the DBAL connecting to the "postgres" database by default is deprecated. Unless you want to have the server
Expand Down
9 changes: 9 additions & 0 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,15 @@ private function getDatabasePlatformVersion()
throw $originalException;
}

Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/5707',
'Relying on a fallback connection used to determine the database platform while connecting'
. ' to a non-existing database is deprecated. Either use an existing database name in'
. ' connection parameters or omit the database name if the platform'
. ' and the server configuration allow that.',
);

// The database to connect to might not yet exist.
// Retry detection without database name connection parameter.
$params = $this->params;
Expand Down