[Dbix-class] Support for inline where (left join with extra condition)

brew brewsterbear at gmail.com
Wed Mar 13 22:18:37 GMT 2013


Hi,

Anyone know of native support queries like:

SELECT * FROM artist a LEFT JOIN cd c *ON a.name =3D c.artist AND c.year =
=3D =

2000*

Note the complex on clause.

This is basically a four year bump of this thread: =

http://dbix-class.35028.n2.nabble.com/Left-join-with-an-extra-condition-td3=
880896.html =



Peter and Bill point out we can use a literal string:

from =3D> \q{
artist me LEFT JOIN gig gigs
ONme.id <http://me.id/>=3D gigs.artist
AND gigs.venue =3D 'outside'
             },


but we'd loose joins and prefetch.  I'd rather not create a view for =

these types of queries and just use a subselect or two queries.


Cheers

Brew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20130313/8f1=
f662d/attachment.htm


More information about the DBIx-Class mailing list