I think DBIx::Class::ResultClass::HashRefInflator also could be useful: http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/ResultClass/HashRefInflator.pm
2010/10/5 Jason Galea <[email protected]>: > On Tue, Oct 5, 2010 at 12:58 PM, <[email protected]> wrote: >> The docs appear to say that DBIx can return column values (rather than >> objects), but I can't get it to work. Have tried "select" attribute and also >> "columns" attribute. In both cases, it inflates to objects. I have a simple >> (left) join of two tables and want to retrieve all the id's of the "foo" >> table. >> $rs = $self->schema->resultset('My:Bar'); >> my @foo_ids = $rs->search( >> { >> bar => $bar->id, >> }, >> { >> join => 'foo', >> select => [qw/foo.id/], >> } >> ); > > I think you want the get_column method.. > > my @foo_ids = $rs->search( > { > bar => $bar->id, > }, > { > join => 'foo', > select => [qw/foo.id/], > } > )->get_column('foo.id'); > > cheers, > > J > >> Sorry for this newbie question, but just can't get it to work. >> Thanks! >> >> >> -- >> Bikewise: http://www.bikewise.org >> >> >> _______________________________________________ >> 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/[email protected] >> > > > > -- > Jason Galea > Web Developer > > Ph 07 40556926 > Mob 04 12345 534 > www.eightdegrees.com.au > > _______________________________________________ > 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/[email protected] > -- Sincerely yours, Oleg Kostyuk (CUB-UANIC) _______________________________________________ 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/[email protected]
