[Dbix-class] specify join type

michael reddick michael.reddick at gmail.com
Thu Feb 19 16:53:12 GMT 2009


On Thu, Feb 19, 2009 at 10:35 AM, Bernhard Graf <dbic3 at augensalat.de> wrote:

> Is it possible to specify the join type for the result set?
>
> E.g. I have a user who might have several items, but I want only those
> users, that actually have items.
>
> E.g. this gives me a left join:
>
> $schema->resultset('User')->search(
>  {},
>  {
>     join =3D> 'items'
>     group_by =3D> 'me.id',
>  }
> );
>

something like this i think is what you're after...

$schema->resultset('User')->search(
 { items.id =3D> { '!=3D' =3D> undef },
 {
    join =3D> 'items'
    group_by =3D> 'me.id',
 }
);


michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20090219/a0b=
a9a1d/attachment.htm


More information about the DBIx-Class mailing list