Proposal: confusion on the eager on connection and function behaviors #307
Labels
f: associations
the associations feature in pop
proposal
A suggestion for a change, feature, enhancement, etc
Milestone
Hi @mclark4386, @stanislas-m, and all!
I wonder following behaviors:
Query.Clone()
does not copyeager
andeagerFields
. Is it desired action?pop/query.go
Lines 29 to 54 in 53115b9
I tried to do something like following before I looking in it:
It does not work as I imagine. I think
Clone()
should copy everything.But for
Q(Connection)
, it copieseager
andeagerFields
even though the comment said it will create a new "empty" query.pop/query.go
Lines 178 to 186 in 53115b9
I know, when we call
Connection.Where(...)
, it internally doQ(c)
and we can get query with earger information without further action. So I can improve my routine like below:But this code is not smoothly read.
When I found this sequence at the first time, I wonder why
Connection
haseager
andeagerFields
but now I found it is required for the eager version of executors. But I feel it makes some confusion and I just thought about:Eager
andConnection.Eager()
returnsEager
instead of NEWConnection
andEager.Where()
wrapper andEager.Create()
wrapper, and so on,...Then, can we keep the structure more simple?
I know there are busy actions on the eager implementation recently. Can you consider above confusion and idea?
The text was updated successfully, but these errors were encountered: