Conversation
# Conflicts: # composer.lock # src/Database/Adapter.php # src/Database/Adapter/MariaDB.php # src/Database/Adapter/Mongo.php # src/Database/Adapter/Postgres.php # src/Database/Adapter/SQL.php # src/Database/Database.php # src/Database/Query.php # src/Database/Validator/Query/Order.php # src/Database/Validator/Query/Select.php # tests/unit/Validator/Query/OrderTest.php
# Conflicts: # composer.lock # src/Database/Adapter/Mongo.php # src/Database/Adapter/Postgres.php # src/Database/Validator/Query/Filter.php
# Conflicts: # src/Database/Validator/Query/Filter.php
# Conflicts: # src/Database/Adapter/Mongo.php
# Conflicts: # src/Database/Database.php # src/Database/Query.php # src/Database/Validator/Queries.php # src/Database/Validator/Query/Filter.php
# Conflicts: # src/Database/Adapter/SQL.php # src/Database/Database.php
abnegate
reviewed
Mar 6, 2026
Comment on lines
+5977
to
+5981
| foreach (['$permissions', '$sequence'] as $required) { | ||
| if (!$batch[0]->offsetExists($required)) { | ||
| throw new QueryException("Missing required attribute {$required} in select query"); | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
Can we add them instead, if we need them internally?
| ); | ||
| } | ||
|
|
||
| foreach ($context->getCollections() as $_collection) { |
Member
There was a problem hiding this comment.
Let's name the loop var $contextCollection
Comment on lines
-8622
to
+8676
| $documentHashKey = $documentKey . ':' . \md5(\implode($selects)); | ||
| $documentHashKey = $documentKey . ':' . \md5(\serialize($selects)); |
Member
There was a problem hiding this comment.
Why change this? We'll end up with different keys right?
Comment on lines
+2026
to
+2035
| ?int $limit = 25, | ||
| ?int $offset = null, | ||
| array $cursor = [], | ||
| string $cursorDirection = Database::CURSOR_AFTER, | ||
| string $forPermission = Database::PERMISSION_READ, | ||
| array $selects = [], | ||
| array $filters = [], | ||
| array $joins = [], | ||
| array $vectors = [], | ||
| array $orderQueries = [] |
Member
There was a problem hiding this comment.
Can we get these from context instead of separate params? context->getLimit() for example
Comment on lines
+3198
to
+3201
| if (!empty($sqlJoin)) { | ||
| var_dump($sql); | ||
| } | ||
|
|
| use Utopia\Validator\Integer; | ||
| use Utopia\Validator\Text; | ||
|
|
||
| class V2 extends Validator |
Member
There was a problem hiding this comment.
Let's remove the old one and rename to Queries
Comment on lines
+698
to
+712
| if ($options['relationType'] === Database::RELATION_ONE_TO_ONE && $options['twoWay'] === false && $options['side'] === Database::RELATION_SIDE_CHILD) { | ||
| throw new \Exception('Cannot query on virtual relationship attribute'); | ||
| } | ||
|
|
||
| if ($options['relationType'] === Database::RELATION_ONE_TO_MANY && $options['side'] === Database::RELATION_SIDE_PARENT) { | ||
| throw new \Exception('Cannot query on virtual relationship attribute'); | ||
| } | ||
|
|
||
| if ($options['relationType'] === Database::RELATION_MANY_TO_ONE && $options['side'] === Database::RELATION_SIDE_CHILD) { | ||
| throw new \Exception('Cannot query on virtual relationship attribute'); | ||
| } | ||
|
|
||
| if ($options['relationType'] === Database::RELATION_MANY_TO_MANY) { | ||
| throw new \Exception('Cannot query on virtual relationship attribute'); | ||
| } |
| return false; | ||
| } | ||
|
|
||
| if (\strlen($value) >= 64) { |
Comment on lines
-1579
to
+1581
| Query::select(['string', 'integer_signed']), | ||
| Query::select('string'), | ||
| Query::select('integer_signed'), |
Member
There was a problem hiding this comment.
Can we still allow passing array?
| convertWarningsToExceptions="true" | ||
| processIsolation="false" | ||
| stopOnFailure="false" | ||
| stopOnFailure="true" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by CodeRabbit
New Features
Refactor