Skip to content

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