On 05/08/2015 05:43 PM, Eugen Konkov via RT wrote:
Show quoted text> Queue: DBIx-Class
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=104289 >
>
> How about?
>
> $rs2 = $rs->search( ... , { join => 'lefttablename' );
> $rs3 = $rs2->search( ..., { rjoin => 'righttablename' } );
>
> print $rs3->as_query;
>
> SELECT * FROM ...
> LEFT JOIN lefttablename ON ...
> RIGHT JOIN righttablename ON ...
>
> In ::Relation::RightTableName.pm we have:
>
> righttablename->belongs_to/has_one/many_to_many( lefttablename, ...
>
>
> so if we use 'rjoin' as option we explicitly ask to generate RIGHT JOIN
> if we use 'ljoin' as option we explicitly ask to generate LEFT JOIN
> if we use 'join' as option we rely on 'join_type' attribute or default behaviour of 'has_many', 'belongs_to' etc.
You misunderstood me. The *RESULT* of a right join is useless, because
there is nothing the DBIC result parser could attach it to.
You are fundamentally misunderstanding what the 'join' attribute does in
the first place. Please join the IRC channel and poke someone for a more
interactive explanation (refer to this RT)