Skip to content

Commit e82b4a0

Browse files
committed
Fix adapter check
1 parent 94815bf commit e82b4a0

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/Database/Adapter/SQL.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,7 @@ public function updateDocuments(Document $collection, Document $updates, array $
566566
}
567567

568568
$bindKey = 'key_' . $keyIndex;
569-
// For PostgreSQL, preserve boolean values directly
570-
if (!($this instanceof \Utopia\Database\Adapter\Postgres && \is_bool($value))) {
569+
if ($this->getSupportForIntegerBooleans()) {
571570
$value = (\is_bool($value)) ? (int)$value : $value;
572571
}
573572
$stmt->bindValue(':' . $bindKey, $value, $this->getPDOType($value));
@@ -2515,7 +2514,9 @@ public function createDocuments(Document $collection, array $documents): array
25152514
$bindKey = 'key_' . $bindIndex;
25162515
$bindKeys[] = $this->getSpatialGeomFromText(":" . $bindKey);
25172516
} else {
2518-
$value = (\is_bool($value)) ? (int)$value : $value;
2517+
if ($this->getSupportForIntegerBooleans()) {
2518+
$value = (\is_bool($value)) ? (int)$value : $value;
2519+
}
25192520
$bindKey = 'key_' . $bindIndex;
25202521
$bindKeys[] = ':' . $bindKey;
25212522
}

0 commit comments

Comments
 (0)