Skip to content

Commit 1e3ec9a

Browse files
committed
DBAL3: Properly implement getDatabasePlatform?
1 parent 04a9e9d commit 1e3ec9a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Crate/DBAL/Driver/PDOCrate/Driver.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,14 @@ private function constructPdoDsn(array $params): string
7878
*/
7979
public function getDatabasePlatform(): AbstractPlatform
8080
{
81-
return new CratePlatform4();
81+
// FIXME: Chicken egg problem: No connection information here.
82+
// Is this meant to "activate" the right platform *after* a server
83+
// inquiry at all? Isn't it more likely it is NOT meant to work this way?
84+
// Let's investigate how the other vendors are doing it.
85+
$conn = $this->connect();
86+
$version = $conn->getServerVersion();
87+
$platform = $this->createDatabasePlatformForVersion($version);
88+
return $platform;
8289
}
8390

8491
/**

0 commit comments

Comments
 (0)