On 19 Dec 2008, at 19:34, Fernan Aguero wrote:
Hi,
I'd like to fetch data from DBIC in the form of a hash (i.e. indexed
by a key, say a PK) instead of in the form of an array, which is the
native structure of a DBIC RS.
In plain DBI, I can do it using selectall_hashref, and specifying the
column to use as the hash key.
Can I do something like this in DBIC? I've looked through the docs and
couldn't find anything, but perhaps there's something very obvious
that is elluding me ...
Cheers,
my $hash = {};
$hash{$_->col} = $_ for ($rs->all);
Its just perl.
_______________________________________________
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]