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; }