ok( unlink($_), "Deleted old SQL $_ OK" );
}
-my $schema = ViewDeps->connect( 'dbi:SQLite:dbname=t/var/viewdeps.db',
+my $schema = ViewDeps->connect( 'dbi:SQLite::memory:',
{ quote_char => '"', } );
ok( $schema, 'Connected to ViewDeps schema OK' );
is_deeply(\@sorted_sources,\@sqlt_sources,"SQLT view order triumphantly matches our order.");
+#################### AND WHAT ABOUT USING THE SCHEMA?
+
+my $a_name_rs = $schema->resultset('ANameArtists');
+my $ab_name_rs = $schema->resultset('AbNameArtists');
+my $aba_name_rs = $schema->resultset('AbaNameArtists');
+my $aba_name_cds_rs = $schema->resultset('AbaNameArtistsAnd2010CDsWithManyTracks');
+my $track_five_rs = $schema->resultset('TrackNumberFives');
+my $year_2010_rs = $schema->resultset('Year2010CDs');
+my $year_2010_cds_rs = $schema->resultset('Year2010CDsWithManyTracks');
+
+ok($a_name_rs, "ANameArtists resultset is OK");
+ok($ab_name_rs, "AbNameArtists resultset is OK");
+ok($aba_name_rs, "AbaNameArtists resultset is OK");
+ok($aba_name_cds_rs, "AbaNameArtistsAnd2010CDsWithManyTracks resultset is OK");
+ok($track_five_rs, "TrackNumberFives resultset is OK");
+ok($year_2010_rs, "Year2010CDs resultset is OK");
+ok($year_2010_cds_rs, "Year2010CDsWithManyTracks resultset is OK");
+
done_testing;
__PACKAGE__->table_class('DBIx::Class::ResultSource::View');
__PACKAGE__->table('year_2010_cds_with_many_tracks');
__PACKAGE__->result_source_instance->view_definition(
- "SELECT cd.id,cd.title,cd.artist,cd.year,cd.number_tracks,art.id FROM year_2010_cds cd,artwork art WHERE cd.number_tracks > 10 AND art.cd = cd.id"
+ "SELECT cd.id,cd.title,cd.artist,cd.year,cd.number_tracks,art.file FROM year_2010_cds cd JOIN artwork art on art.cd = cd.id WHERE cd.number_tracks > 10"
);
__PACKAGE__->result_source_instance->deploy_depends_on(
artist => { data_type => 'integer', is_nullable => 0 },
year => { data_type => 'integer' },
number_tracks => { data_type => 'integer' },
- artwork => { data_type => 'integer' },
+ file => { data_type => 'integer' },
);
__PACKAGE__->set_primary_key('id');