From e82b4a07b80cc6e6f6438ec08d1cdcace74c58d6 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 13 Feb 2026 14:20:06 +1300 Subject: [PATCH] Fix adapter check --- src/Database/Adapter/SQL.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Database/Adapter/SQL.php b/src/Database/Adapter/SQL.php index 9c4a81046..86dd5cd18 100644 --- a/src/Database/Adapter/SQL.php +++ b/src/Database/Adapter/SQL.php @@ -566,8 +566,7 @@ public function updateDocuments(Document $collection, Document $updates, array $ } $bindKey = 'key_' . $keyIndex; - // For PostgreSQL, preserve boolean values directly - if (!($this instanceof \Utopia\Database\Adapter\Postgres && \is_bool($value))) { + if ($this->getSupportForIntegerBooleans()) { $value = (\is_bool($value)) ? (int)$value : $value; } $stmt->bindValue(':' . $bindKey, $value, $this->getPDOType($value)); @@ -2515,7 +2514,9 @@ public function createDocuments(Document $collection, array $documents): array $bindKey = 'key_' . $bindIndex; $bindKeys[] = $this->getSpatialGeomFromText(":" . $bindKey); } else { - $value = (\is_bool($value)) ? (int)$value : $value; + if ($this->getSupportForIntegerBooleans()) { + $value = (\is_bool($value)) ? (int)$value : $value; + } $bindKey = 'key_' . $bindIndex; $bindKeys[] = ':' . $bindKey; }