n+1
problem with eager loading models in different databases (connections)
#2653
Labels
question
Request for support or clarification
What problem does this feature proposal attempt to solve?
I found
n+1
problem with eager loading models in different databases (connections). Currently, the code will not eager load entitles that live on two different connections. I debug and tracked the problem to this specific line atsrc/Schema/Directives/RelationDirective.php
:Which possible solutions should be considered?
I don't know what is the rationale for this limitation but that should be OK by default to eager load models on different connections. To solve this problem we can either eliminate this limitation or introduce new config variable that allows to override this check at
$this->isSameConnection($relation)
, something like:The text was updated successfully, but these errors were encountered: