-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
[12.x] Query builder PDO fetch modes + columns fix #54734
Conversation
Thanks for submitting a PR! Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface. Pull requests that are abandoned in draft may be closed due to inactivity. |
Have you considered allowing to set the fetch mode via User::query(PDO::FETCH_UNIQUE)->select(['id','users.*'])->get(); |
Yes I did; I dont think this is a feature that should be on the forefront that much so I thought a simple chained function would be better. Also when using A |
Yeah, that makes sense 👍🏻 Maybe, this can be additionally added as a convenience feature in a follow-up PR if it appears to be beneficial 🤔 |
@bert-w Same question as here #54443 (comment) Will this work in Laravel 8-11 with onceWithColumns function with just |
That would need to be added in Laravel 13 as it would be a breaking change in the definition of the query function and of the subsequent functions called with that param. |
Yeah, thanks for the hint 👍🏻 |
Same PR as #54443 , with the addition of a fix for #54708 + testcase.
The issue was caused by my assumption that pluck-arguments should override the
$this->columns
property in all situations. This however is not the case since you can do a:therefore requiring the custom named column. So the code to set the columns should remain: