Sketches of tests that should ultimately pass
[dbsrgits/DBIx-Class.git] / t / prefetch / manual.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5 use Test::Exception;
6 use lib qw(t/lib);
7 use DBICTest;
8
9 my $schema = DBICTest->init_schema();
10
11 my $rs = $schema->resultset ('CD')->search ({}, {
12   join => [ 'tracks', { single_track => { cd => { artist => { cds => 'tracks' } } } }  ],
13   collapse => 1,
14   columns => [
15     { 'year'                                    => 'me.year' },               # non-unique
16     { 'genreid'                                 => 'me.genreid' },            # nullable
17     { 'tracks.title'                            => 'tracks.title' },          # non-unique (no me.id)
18     { 'single_track.cd.artist.cds.cdid'         => 'cds.cdid' },              # to give uniquiness to ...tracks.title below
19     { 'single_track.cd.artist.cds.artist'       => 'cds.artist' },            # non-unique
20     { 'single_track.cd.artist.cds.year'         => 'cds.year' },              # non-unique
21     { 'single_track.cd.artist.cds.genreid'      => 'cds.genreid' },           # nullable
22     { 'single_track.cd.artist.cds.tracks.title' => 'tracks_2.title' },        # unique when combined with ...cds.cdid above
23     { 'latest_cd'                               => { max => 'cds.year' } },   # random function
24   ],
25   result_class => 'DBIx::Class::ResultClass::HashRefInflator',
26 });
27
28 use Data::Dumper::Concise;
29 die Dumper [$rs->all];
30
31