[Dbix-class] Right join
Matt S Trout
dbix-class at trout.me.uk
Fri Jan 27 19:27:24 CET 2006
On Fri, Jan 27, 2006 at 04:46:18PM +0100, TAPO (Thomas Agersten Poulsen) wrote:
> Dear Matt,
>
> Thank you for the rapid response.
>
> Unfortunately I still get the left join:
>
> $req->requestedseq()->search_related('response')->count()
> gives
>
> SELECT COUNT( * ) FROM requested_seqs me LEFT JOIN responses response ON
> ( response.requested_sequence = me.id ) WHERE ( request = ? ): 96
>
> Can it be that the auto-loader does not detect the relationship?
No, I was being stupid, sorry. Start off with a search against response
and join back to requested_seqs is probably your best bet.
> It would be great if I could give it a "-join-type"; something like
> $req->requestedseq()->search_related('response',{},-join-type=>'right')-
> >count()
You can specify the join type at relationship setup time if you're setting
your own relationships up, but if you're Loader-ing that probably doesn't
help :)
--
Matt S Trout Offering custom development, consultancy and support
Technical Director contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information
+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +
More information about the Dbix-class
mailing list