File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed
Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -3896,12 +3896,26 @@ earlier versions of DBIC, but this is deprecated)
38963896
38973897Essentially C<columns > does the same as L</select> and L</as> .
38983898
3899- columns => [ 'foo ', { bar => 'baz ' } ]
3899+ columns => [ 'some_column ', { dbic_slot => 'another_column ' } ]
39003900
39013901is the same as
39023902
3903- select => [qw/foo baz/],
3904- as => [qw/foo bar/]
3903+ select => [qw(some_column another_column)],
3904+ as => [qw(some_column dbic_slot)]
3905+
3906+ If you want to individually retrieve related columns (in essence perform
3907+ manual prefetch) you have to make sure to specify the correct inflation slot
3908+ chain such that it matches existing relationships:
3909+
3910+ my $rs = $schema->resultset('Artist')->search({}, {
3911+ # required to tell DBIC to collapse has_many relationships
3912+ collapse => 1,
3913+ join => { cds => 'tracks'},
3914+ '+columns' => {
3915+ 'cds.cdid' => 'cds.cdid',
3916+ 'cds.tracks.title' => 'tracks.title',
3917+ },
3918+ });
39053919
39063920=head2 +columns
39073921
You can’t perform that action at this time.
0 commit comments