Skip to content

Commit 83ee3b0

Browse files
committed
Merge branch 'main' of github.com:utopia-php/database into abstract-execute-method
2 parents edbc05e + 82fd1ae commit 83ee3b0

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Database/Adapter/SQL.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
use Utopia\Database\Exception as DatabaseException;
1111
use Utopia\Database\Exception\Duplicate as DuplicateException;
1212
use Utopia\Database\Exception\NotFound as NotFoundException;
13+
use Utopia\Database\Exception\Query as QueryException;
1314
use Utopia\Database\Exception\Transaction as TransactionException;
14-
use Utopia\Database\PDO;
1515
use Utopia\Database\Query;
1616

1717
abstract class SQL extends Adapter
@@ -1606,6 +1606,9 @@ public function getSQLConditions(array $queries, array &$binds, string $separato
16061606
{
16071607
$conditions = [];
16081608
foreach ($queries as $query) {
1609+
if (!$query instanceof Query) {
1610+
throw new QueryException('Invalid query type: "' . \gettype($query) . '". Expected instances of "' . Query::class . '"');
1611+
}
16091612

16101613
if ($query->getMethod() === Query::TYPE_SELECT) {
16111614
continue;

0 commit comments

Comments
 (0)