Skip to content

[10.x] Make default ID column configurable in Query\Builder::find forPageBeforeId and forPageAfterId #48089

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

Closed
wants to merge 1 commit into from

Conversation

GromNaN
Copy link
Contributor

@GromNaN GromNaN commented Aug 16, 2023

The protected method Illuminate\Database\Query\Builder::defaultKeyName() is already used in Illuminate\Database\Concerns\BuildsQueries::chunkById() and Illuminate\Database\Concerns\BuildsQueries::orderedLazyById(). It was introduced by #28065.

This is necessary to avoid overloading this methods only to change the default value of the $column argument.
Example: MongoDB uses _id by default. We have to redefine the methods.

@GromNaN GromNaN changed the title Make ID column configurable in Query\Builder find forPageBeforeId and forPageAfterId Make ID column configurable in Query\Builder find forPageBeforeId and forPageAfterId Aug 16, 2023
@GromNaN GromNaN marked this pull request as draft August 16, 2023 22:17
@GromNaN GromNaN marked this pull request as ready for review August 16, 2023 22:31
@GromNaN GromNaN changed the title Make ID column configurable in Query\Builder find forPageBeforeId and forPageAfterId Make default ID column configurable in Query\Builder::find forPageBeforeId and forPageAfterId Aug 16, 2023
@GromNaN GromNaN changed the title Make default ID column configurable in Query\Builder::find forPageBeforeId and forPageAfterId [10.x] Make default ID column configurable in Query\Builder::find forPageBeforeId and forPageAfterId Aug 17, 2023
@taylorotwell
Copy link
Member

I really don't think trying to shoehorn the relational query builder into a MongoDB supporting query builder is a good idea. 😬

@GromNaN
Copy link
Contributor Author

GromNaN commented Aug 17, 2023

What’s the point of Illuminate\Database\Query\Builder::defaultKeyName() if you don’t use it where the default key name is expected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants