db
db copied to clipboard
Restore Query::one interface
Q | A |
---|---|
Is bugfix? | ✔️ |
New feature? | ✔️ |
Breaks BC? | ✔️/❌ |
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.55%. Comparing base (
749c3f3
) to head (6e904c6
).
Additional details and impacted files
@@ Coverage Diff @@
## master #798 +/- ##
=========================================
Coverage 99.55% 99.55%
Complexity 1277 1277
=========================================
Files 63 63
Lines 3120 3120
=========================================
Hits 3106 3106
Misses 14 14
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
PR Summary
-
Modifications to the
queryOne()
method ThequeryOne()
function, which can be found inAbstractCommand.php
,CommandInterface.php
, andCommandInterfaceProxy.php
, underwent revisions that enable it to provide a more diverse set of results. This function formerly returned only arrays, but with this update, it can now return an array, an object, or even a null value. This improvement enhances the flexibility and coverage of the response types our system can deliver. -
Improvements to the
one()
method Similar to thequeryOne()
modifications, we have updated theone()
function inQuery.php
andQueryInterface.php
to return either an array, an object, or a null value. Previously, the function was limited to just array results. This change broadens the scope of possible outputs, making our system more diverse and adaptable in responding to different query requirements.
BatchQueryResult::$value
and related methods also should have the typearray|object|null
It's maybe incorrect for query with one column as scalar type.
BatchQueryResult::$value
and related methods also should have the typearray|object|null
It's maybe incorrect for query with one column as scalar type.
This should be an array or object ($row) or array of arrays or objects ($rows) or null, but seems this is not related with the PR.
https://github.com/yiisoft/db/blob/ef81e8b7749525030dba95060b71a9f490fe2784/src/Query/BatchQueryResult.php#L103 https://github.com/yiisoft/db/blob/ef81e8b7749525030dba95060b71a9f490fe2784/src/Command/AbstractCommand.php#L425-L429
And after custom populate closure $rows
can be changed to array of object
s
https://github.com/yiisoft/db/blob/ef81e8b7749525030dba95060b71a9f490fe2784/src/Query/BatchQueryResult.php#L108-L110
Needs line to changelog
And fill UPGRADE.md
too