Skip to content

Commit b377a07

Browse files
authored
Merge pull request #5707 from morozov/deprecate-platform-detection-fallback
Deprecate fallback connection to determine platform
2 parents 3fb5745 + e4be6fa commit b377a07

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

UPGRADE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ awareness about deprecated code.
88

99
# Upgrade to 3.5
1010

11+
## Deprecated fallback connection used to determine the database platform.
12+
13+
Relying on a fallback connection used to determine the database platform while connecting to a non-existing database
14+
has been deprecated. Either use an existing database name in connection parameters or omit the database name
15+
if the platform and the server configuration allow that.
16+
1117
## Deprecated default PostgreSQL connection database.
1218

1319
Relying on the DBAL connecting to the "postgres" database by default is deprecated. Unless you want to have the server

src/Connection.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,15 @@ private function getDatabasePlatformVersion()
400400
throw $originalException;
401401
}
402402

403+
Deprecation::trigger(
404+
'doctrine/dbal',
405+
'https://github.com/doctrine/dbal/pull/5707',
406+
'Relying on a fallback connection used to determine the database platform while connecting'
407+
. ' to a non-existing database is deprecated. Either use an existing database name in'
408+
. ' connection parameters or omit the database name if the platform'
409+
. ' and the server configuration allow that.',
410+
);
411+
403412
// The database to connect to might not yet exist.
404413
// Retry detection without database name connection parameter.
405414
$params = $this->params;

0 commit comments

Comments
 (0)