8 my $schema = DBICTest->init_schema(no_deploy => 1);
11 my $irow = $schema->source ('Artwork')->_parse_row (
15 'artwork_to_artist.artist_id' => '2',
16 'artwork_to_artist.artwork_cd_id' => '1',
20 'cd.title' => 'Spoonful of bees',
22 'cd.artist.artistid' => '1',
23 'cd.artist.name' => 'Caterwauler McCrae',
35 'artwork_to_artist' => [
39 'artwork_cd_id' => '1'
48 'title' => 'Spoonful of bees',
54 'name' => 'Caterwauler McCrae',
61 '_parse_row works as expected with expected collapse',
64 $irow = $schema->source ('Artist')->_parse_row (
66 'name' => 'Caterwauler McCrae',
67 'cds.tracks.cd' => '3',
68 'cds.tracks.title' => 'Fowlin',
69 'cds.tracks.cd_single.title' => 'Awesome single',
76 'name' => 'Caterwauler McCrae'
90 title => 'Awesome single',
99 '_parse_row works over missing joins without collapse',
102 my ($collapse_map, $order) = $schema->source ('CD')->_resolve_collapse (
105 'genreid', # nullable
106 'tracks.title', # non-unique (no me.id)
107 'single_track.cd.artist.cds.cdid', # to give uniquiness to ...tracks.title below
108 'single_track.cd.artist.cds.artist', # non-unique
109 'single_track.cd.artist.cds.year', # non-unique
110 'single_track.cd.artist.cds.genreid', # nullable
111 'single_track.cd.artist.cds.tracks.title',# unique when combined with ...cds.cdid above
112 'latest_cd', # random function
120 "single_track.cd.artist.cds.artist" => 1
125 "single_track.cd.artist.cds.artist" => 1
130 "single_track.cd.artist.cds.artist" => 1
135 "single_track.cd.artist.cds.artist" => 1
140 "single_track.cd.artist.cds.cdid" => 1
145 "single_track.cd.artist.cds.cdid" => 1,
146 "single_track.cd.artist.cds.tracks.title" => 1
155 "single_track.cd.artist.cds.artist" => 1,
160 "Proper collapse map constructed",