9 my $schema = DBICTest->init_schema();
11 eval "use DBD::SQLite";
12 plan skip_all => 'needs DBD::SQLite for testing' if $@;
16 test fails with select => [ ], when the columns required for the relationship are absent
20 with select => [ qw / me.name cds.title ] (missing columns required for relationships)
22 SELECT me.name, cds.title, cds.cdid, cds.artist, cds.title, cds.year, cds.genreid, cds.single_track
24 LEFT JOIN cd cds ON cds.artist = me.artistid
25 WHERE ( cds.title != ? )
26 GROUP BY me.name, cds.title
27 ORDER BY me.name, cds.title, cds.artist, cds.year: 'Generic Manufactured Singles'
29 ****************************************************************************************************************************
33 SELECT me.artistid, me.name, me.rank, me.charfield, cds.cdid, cds.artist, cds.title, cds.year, cds.genreid, cds.single_track
35 LEFT JOIN cd cds ON cds.artist = me.artistid
36 WHERE ( cds.title != ? )
37 GROUP BY me.artistid, me.name, me.rank, me.charfield
38 ORDER BY me.name, cds.title, cds.artist, cds.year: 'Generic Manufactured Singles'
43 my $rs = $schema->resultset('Artist')->search({ 'cds.title' => { '!=' => 'Generic Manufactured Singles' } }, ## exists
44 { prefetch => [ qw/ cds / ],
45 join => [ qw/ cds / ],
46 select => [ qw/ me.name cds.title / ],
48 order_by => [ qw/ me.name cds.title / ],
51 lives_ok(sub { $rs->first }, 'Lives ok');