++ed by:
KEEDI AWNCORP PERLANCAR

3 PAUSE users
7 non-PAUSE users.

Laurent Dami
and 1 contributors

NAME

DBIx::DataModel::Schema::ResultAs::Hashref - arrange data rows in a hash

SYNOPSIS

  $source->select(..., -result_as => 'hashref');
  # or
  $source->select(..., -result_as => [hashref => ($key1, ...)]);

DESCRIPTION

The result will be a hashref. Keys in the hash correspond to distinct values of the specified columns, and values are data row objects. If the argument is given as [hashref => @cols], the column(s) are specified by the caller; otherwise if the argument is given as a simple string, @cols will default to $source->primary_key. If there is more than one column, the result will be a tree of nested hashes. This -result_as is normally used only where the key fields values for each row are unique. If multiple rows are returned with the same values for the key fields then later rows overwrite earlier ones.