Skip to content
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

[11.x] Support eager loading with limit #49695

Merged
merged 3 commits into from Jan 15, 2024

Conversation

staudenmeir
Copy link
Contributor

@staudenmeir staudenmeir commented Jan 15, 2024

As discussed: A new version of #26035 that integrates the eloquent-eager-limit package.

Support for MySQL 5.7

According to the current docs, Laravel 11 won't support MySQL 5.7 anymore. I still included the legacy workaround for MySQL 5.7 since the necessary code already exists and MySQL 5.7 is still being tested. The MySQL support in Laravel 11 is also still being discussed.

@staudenmeir
Copy link
Contributor Author

The failing tests aren't related to this PR.

@decadence
Copy link
Contributor

@staudenmeir Massive work 💪

Hope your other packages will have Laravel team attention. HasManyDeep is mind-blowing.

*/
public function useLegacyGroupLimit(Builder $query)
{
$version = $query->getConnection()->getReadPdo()->getAttribute(PDO::ATTR_SERVER_VERSION);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$version = $query->getConnection()->getReadPdo()->getAttribute(PDO::ATTR_SERVER_VERSION);
$version = $query->getConnection()->getServerVersion();

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you maybe send in a follow up PR with your suggestions? Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: #49723

*/
protected function compileGroupLimit(Builder $query)
{
$version = $query->getConnection()->getReadPdo()->getAttribute(PDO::ATTR_SERVER_VERSION);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$version = $query->getConnection()->getReadPdo()->getAttribute(PDO::ATTR_SERVER_VERSION);
$version = $query->getConnection()->getServerVersion();

@taylorotwell taylorotwell merged commit 8f29cc9 into laravel:master Jan 15, 2024
11 of 28 checks passed
@taylorotwell
Copy link
Member

Thanks @staudenmeir! 🥳

@thanhnguyenphuocnhat
Copy link

Great work!!!

@kon3ko
Copy link

kon3ko commented Jan 29, 2024

Thank a lot <3

@mokhosh
Copy link
Contributor

mokhosh commented Jan 30, 2024

can't wait for your other eloquent extension packages to be included in the core.

@lmottasin
Copy link
Contributor

Thank you.

@said-louham
Copy link

Thanks a lot <3

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.

None yet

10 participants