[Dbix-class] prefetching multi

Mark Hedges hedges at ucsd.edu
Fri Apr 7 04:10:57 CEST 2006


Weird.  I can do:

    { prefetch => { some_hasmany => 'their_hasone' } }

and all objects are populated without further queries when I 
call the accessors, but if I do this:

    { prefetch => 'some_hasmany' },

The first SQL calls up the full set of answers, but when I 
iterate through while (my $thing = $rs->next), if I call 
$thing->some_hasmany, it does another query for each one anyway.

And, I cannot do:

    { prefetch => ['some_hasmany1','some_hasmany2'] } 

    ("Prefetch not supported with accessor 'multi'")

even though it does first issue the SQL that would get it all 
the right answers.  

Mark



More information about the Dbix-class mailing list