Skip to content

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Update doc about $db->select() #987

wants to merge 4 commits into from

Conversation

Tigrov
Copy link
Member

@Tigrov Tigrov commented Jun 12, 2025

Merge it before release 2.0

Q A
Is bugfix?
New feature?
Breaks BC?
Fixed issues

@Tigrov Tigrov added the type:docs Documentation label Jun 12, 2025
Copy link

codecov bot commented Jun 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.99%. Comparing base (bfd18e2) to head (2aa289b).

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #987   +/-   ##
=========================================
  Coverage     98.99%   98.99%           
  Complexity     1654     1654           
=========================================
  Files            99       99           
  Lines          4169     4169           
=========================================
  Hits           4127     4127           
  Misses           42       42           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@samdark samdark requested a review from Copilot June 12, 2025 21:36
Copy link

@Copilot Copilot AI left a 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\Query statements 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()

Tigrov and others added 2 commits June 13, 2025 11:47
@Tigrov Tigrov added the status:ready for merge The pull request is OK to be merged. label Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready for merge The pull request is OK to be merged. type:docs Documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants