[Dbix-class] I get only one in a one to one / SOLVED

Jason Galea lists at eightdegrees.com.au
Sat Jan 14 03:01:15 GMT 2012


On Thu, Jan 12, 2012 at 7:21 PM, Miguel Barco <miguelelelele at yahoo.es>wrote:

> Here it is!!  I do not need Prefetch, but a simple Join
>
> In the doc kindly linked by Jason Galea, scrolling up a little in the
> page, it states clearly that Prefetch is used to retrieve "Whole related
> objects", so to get just a "Subset of related fields" a Join is enough.
>
> Apart from +select +as, it is working here with +column
>

the difference there is that it'll do extra queries to get the related
columns. With +select +as you can get it all in one query.

glad you got it working though!

cheers,

J


>
> Thank you all:
> Migue
>
>
>   ------------------------------
> *De:* Jason Galea <lists at eightdegrees.com.au>
> *Para:* Miguel Barco <miguelelelele at yahoo.es>; DBIx::Class user and
> developer list <dbix-class at lists.scsys.co.uk>
> *Enviado:* martes 10 de enero de 2012 14:12
> *Asunto:* Re: [Dbix-class] I get only one in a one to one
>
> AFAIK you can't use the columns attribute for what you are trying to
> achieve, you'll need +select and +as.. see here..
>
>
> https://metacpan.org/module/DBIx::Class::Manual::Joining#Subset-of-relate=
d-fields
>
> cheers,
>
> J
>
>
>
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive:
> http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20120114/af0=
7813a/attachment.htm


More information about the DBIx-Class mailing list