Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #987 +/- ##
=========================================
Coverage 98.62% 98.62%
Complexity 1654 1654
=========================================
Files 120 120
Lines 4306 4306
=========================================
Hits 4247 4247
Misses 59 59 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
vjik
reviewed
Jun 12, 2025
samdark
approved these changes
Jun 12, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates tests and documentation to use the new $db->select() method instead of instantiating queries with new Query($db), and removes now-unnecessary use Yiisoft\Db\Query\Query imports.
- Replace all
new Query($db)calls with$db->select(). - Remove redundant
use Yiisoft\Db\Query\Querystatements from tests. - Update code examples in docs and README to match the new API.
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Db/Query/QueryTest.php | Switched query instantiation to $db->select() |
| tests/Db/Expression/StructuredExpressionBuilderTest.php | Updated expression builder test to use $db->select() |
| tests/Db/Expression/JsonExpressionBuilderTest.php | Updated expression builder test to use $db->select() |
| tests/Db/Expression/ArrayExpressionBuilderTest.php | Updated expression builder test to use $db->select() |
| tests/Common/CommonCommandTest.php | Replaced new Query($db) with $db->select() in assertions |
| tests/AbstractConnectionTest.php | Updated batch query result creation to use $db->select() |
| src/Query/QueryInterface.php | Updated doc example to use $db->select() |
| docs/guide/pt-BR/query/with-query.md | Changed example to use $db->select() |
| docs/guide/pt-BR/query/where.md | Changed example to use $db->select() |
| docs/guide/pt-BR/query/union.md | Changed example to use $db->select() |
| docs/guide/pt-BR/query/select.md | Changed example to use $db->select() |
| docs/guide/pt-BR/query-builder.md | Changed example to use $db->select() |
| docs/guide/en/schema/typecasting.md | Changed example to use $db->select() |
| docs/guide/en/query/with-query.md | Changed example to use $db->select() |
| docs/guide/en/query/where.md | Changed example to use $db->select() |
| docs/guide/en/query/union.md | Changed example to use $db->select() |
| docs/guide/en/query/select.md | Changed example to use $db->select() |
| docs/guide/en/query-builder.md | Changed example to use $db->select() |
| README.md | Updated sample usage to use $db->select() |
Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>
vjik
approved these changes
Jun 13, 2025
Member
|
@Tigrov time to update/merge it? |
Member
Author
|
Before release 2.0 |
# Conflicts: # tests/AbstractConnectionTest.php # tests/Db/Expression/Value/Builder/ArrayValueBuilderTest.php # tests/Db/Expression/Value/Builder/JsonValueBuilderTest.php # tests/Db/Expression/Value/Builder/StructuredValueBuilderTest.php
# Conflicts: # README.md # tests/AbstractConnectionTest.php # tests/Common/CommonCommandTest.php
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.
Merge it before release 2.0