feat: Allow RawSql JOIN tables (#9070) - #10571
wakqasahmed wants to merge 4 commits into
Conversation
|
The updated JOIN regressions pass locally (16 tests), and the review fix is in 9d63234. The Oracle CI job failed in the randomized AutoReview test |
…vity error unrelated to this diff)
michalsn
left a comment
There was a problem hiding this comment.
I think it looks good. But please update the join signature in Model.php.
| .. code-block:: php | ||
|
|
||
| use CodeIgniter\Database\RawSql; | ||
|
|
||
| $builder->join( | ||
| new RawSql('(SELECT user_id, MAX(created_at) AS latest FROM posts GROUP BY user_id) recent'), | ||
| 'recent.user_id = users.id', | ||
| 'LEFT' | ||
| ); |
There was a problem hiding this comment.
Please use .. literalinclude:: instead - just like it's done in line 302.
There was a problem hiding this comment.
Thanks! Updated the join signature in Model.php and moved the example to query_builder/134.php with literalinclude.
Description
RawSqlas the JOIN table, including in the Postgre and SQLSRV builders.The new base test failed with the original
TypeErrorbefore the change. The local PHP image has no coverage driver, so coverage is left to CI.Closes #9070.
Test plan:
JoinTest.php(14 tests)Checklist: