Wrong queries fired while using preload with null relationships #973
Labels
Status: Awaiting More Information
Waiting on the issue reporter or PR author to provide more information
Type: Question
Needs clarification
Hey guys,
I have two models: Expense and PayementMethod.
Given those business rules, I created these two models:
This is working fine however, while using preload with expenses having null payment methods I see this query in the debugger which doesn't make sense:
It seems like there's some bug (or wrong relationship definition on my end) that tries to get related entities even if the foreing key is null resulting on inefficient DB usage because of sending incorrect queries.
Package version
18.4.2
Node.js and npm version
Node: v18.14.2
Npm: 9.5.0
The text was updated successfully, but these errors were encountered: