On Sun, Jan 1, 2012 at 6:03 PM, Miguel Barco <[email protected]> wrote:
> Thank you!, now I can get all data. But the problem now is that I have
> noticed that the relationship is always present, even when I want to
> retrieve just columns from the main table.
>
> After a query without prefetch, it hits the database with a "SELECT from
> the secondary table" for each one of the rows found from the primary table.
>
> ¿Can it be avoided, or I need to make another schema without relationships?
>
One method to return the result_set with out the prefetch, and one to chain
the prefetch onto the first.
This is not tested code:
sub main_RS {
return $self->search(*the_main_query_to_search_the_main_rows*)
}
sub main_with_related {
return $self->main_RS_method()->search_related(*the_has_one_accessor*)
}
Len.
--
[email protected] 614-404-4214
Proprietor: http://www.theycomewithcheese.com/ - An Homage to Fromage
Grubmaster: Greenbar <http://www.greenbartraining.org/> 2011, 2010, 2009,
Grub Asst. 2008, Trained 2007.
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]