-
-
Notifications
You must be signed in to change notification settings - Fork 43
Update doc about $db->select()
#987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
|
@Tigrov time to update/merge it? |
|
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
Merge it before release 2.0