From 20bd7af370419140c7f2802d6340f5d52f2df163 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Tue, 24 Mar 2026 15:59:42 +0530 Subject: [PATCH] added a fallback isnulll --- .../Modules/Databases/Http/Databases/XList.php | 6 ++---- .../Modules/Databases/Http/TablesDB/XList.php | 12 +++++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/XList.php index 7ff1a27de7..361ea59176 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/XList.php @@ -29,7 +29,7 @@ class XList extends Action protected function getDatabaseTypeQueryFilters(): array { - return [$this->getDatabaseType()]; + return [Query::equal('type', [$this->getDatabaseType()])]; } public function __construct() @@ -96,10 +96,8 @@ class XList extends Action $cursor->setValue($cursorDocument); } - $queries[] = Query::equal('type', $this->getDatabaseTypeQueryFilters()); - try { - $databases = $dbForProject->find('databases', $queries); + $databases = $dbForProject->find('databases', $this->getDatabaseTypeQueryFilters()); $total = $includeTotal ? $dbForProject->count('databases', $queries, APP_LIMIT_COUNT) : 0; } catch (OrderException $e) { throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order column '{$e->getAttribute()}' had a null value. Cursor pagination requires all rows order column values are non-null."); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/XList.php index a9358f3f63..8d84f5b1c8 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/TablesDB/XList.php @@ -9,6 +9,7 @@ use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\Queries\Databases; use Appwrite\Utopia\Response as UtopiaResponse; +use Utopia\Database\Query; use Utopia\Http\Adapter\Swoole\Response as SwooleResponse; use Utopia\Validator\Boolean; use Utopia\Validator\Text; @@ -21,9 +22,14 @@ class XList extends DatabaseXList } protected function getDatabaseTypeQueryFilters(): array - { - return [DATABASE_TYPE_TABLESDB, DATABASE_TYPE_LEGACY]; - } +{ + return [ + Query::or([ + Query::equal('type', [DATABASE_TYPE_TABLESDB, DATABASE_TYPE_LEGACY]), + Query::isNull('type'), + ]), + ]; +} public function __construct() {