Fix sqlite_version (#7205)

* Fix sqlite_version
for https://github.com/FreshRSS/FreshRSS/pull/7161

* Fix PostgreSQL
This commit is contained in:
Alexandre Alapetite authored and GitHub committed 2025-01-10 08:47:52 +01:00
1 parent 82b1d999dc
commit 7a79717e10
3 files changed
+15 -1

No files matched your search

+5 -1
View File
@@ -197,13 +197,17 @@ class FreshRSS_DatabaseDAO extends Minz_ModelPdo {
self::$staticVersion = $version;
}
protected function selectVersion(): string {
return $this->fetchValue('SELECT version()') ?? '';
}
public function version(): string {
if (self::$staticVersion !== null) {
return self::$staticVersion;
}
static $version = null;
if (!is_string($version)) {
$version = $this->fetchValue('SELECT version()') ?? '';
$version = $this->selectVersion();
}
return $version;
}
+5
View File
@@ -59,6 +59,11 @@ SQL;
];
}
#[\Override]
protected function selectVersion(): string {
return $this->fetchValue('SELECT version()') ?? '';
}
#[\Override]
public function size(bool $all = false): int {
if ($all) {
+5
View File
@@ -72,6 +72,11 @@ class FreshRSS_DatabaseDAOSQLite extends FreshRSS_DatabaseDAO {
];
}
#[\Override]
protected function selectVersion(): string {
return $this->fetchValue('SELECT sqlite_version()') ?? '';
}
#[\Override]
public function size(bool $all = false): int {
$sum = 0;