[Dbix-class] prefetch with +select

fREW Schmidt frioux at gmail.com
Mon Jun 7 21:56:32 GMT 2010


On Mon, Jun 7, 2010 at 12:19 PM, Mark A. Stratman <stratman at gmail.com>wrote:

> Is this a bug, or a necessary behavior? Or is there another way I should =
be
> doing a prefetch with +select?
>
> $row =3D $rs->search({}, {
>    '+select' =3D> \'lower(something)',
>    'prefetch' =3D> "relationship",
> })->first;
>
> $row->relationship->first_column; # has the value of 'lower(something)'.
>
> That is to say, every field in the "relationship" is shifted over by the
> +select.
>

First off, could you grab the DBIC source and try to write a failing test
that would do what you expect?  We'd really appreciate it...

Second, and more importantly for you I guess, is that generally a +select
needs a related +as.  If you do the first thing we can make it work, in the
meantime, adding an +as should fix your issue.
-- =

fREW Schmidt
http://blog.afoolishmanifesto.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20100607/7d0=
27832/attachment.htm


More information about the DBIx-Class mailing list