From 2c5ef62d8221afa2ffb33feea5ee83245b50a3fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Wed, 20 Jul 2022 12:42:43 +0200 Subject: [PATCH] Fix SQLite current DB detection --- src/Connection.php | 2 +- src/Platforms/SqlitePlatform.php | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/Connection.php b/src/Connection.php index 46753512aaa..7b072015b49 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -208,7 +208,7 @@ public function getParams() * * @return string|null The name of the database or NULL if a database is not selected. * The platforms which don't support the concept of a database (e.g. embedded databases) - * must always return a string as an indicator of an implicitly selected database. + * must always return an empty string as an indicator of an implicitly selected database. * * @throws Exception */ diff --git a/src/Platforms/SqlitePlatform.php b/src/Platforms/SqlitePlatform.php index 40745d0540e..0027eef98c0 100644 --- a/src/Platforms/SqlitePlatform.php +++ b/src/Platforms/SqlitePlatform.php @@ -165,17 +165,9 @@ public function getDateDiffExpression($date1, $date2) return sprintf("JULIANDAY(%s, 'start of day') - JULIANDAY(%s, 'start of day')", $date1, $date2); } - /** - * {@inheritDoc} - * - * The SQLite platform doesn't support the concept of a database, therefore, it always returns an empty string - * as an indicator of an implicitly selected database. - * - * @see \Doctrine\DBAL\Connection::getDatabase() - */ public function getCurrentDatabaseExpression(): string { - return "''"; + return "'main'"; } /**