[Bast-commits] r9536 - in DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/view-deps: lib/SQL/Translator/Parser/DBIx t t/lib/ViewDeps/Result

amiri at dev.catalyst.perl.org amiri at dev.catalyst.perl.org
Wed Jun 2 00:45:19 GMT 2010


Author: amiri
Date: 2010-06-02 01:45:19 +0100 (Wed, 02 Jun 2010)
New Revision: 9536

Modified:
   DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/view-deps/lib/SQL/Translator/Parser/DBIx/Class.pm
   DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/view-deps/t/105view_deps.t
   DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/view-deps/t/lib/ViewDeps/Result/Year2010CDsWithManyTracks.pm
Log:
Finish ViewDeps: fix a join in test class, put attribs on Parser, add resultset tests for 105view_deps.t, use memory store for SQLite. 



Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/view-deps/lib/SQL/Translator/Parser/DBIx/Class.pm
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/view-deps/lib/SQL/Translator/Parser/DBIx/Class.pm	2010-06-01 23:26:37 UTC (rev 9535)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/view-deps/lib/SQL/Translator/Parser/DBIx/Class.pm	2010-06-02 00:45:19 UTC (rev 9536)
@@ -453,10 +453,16 @@
 
 L<SQL::Translator>, L<DBIx::Class::Schema>
 
-=head1 AUTHORS
+=head1 AUTHOR
 
-See L<DBIx::Class/CONTRIBUTORS>.
+Jess Robinson
 
+=head2 CONTRIBUTORS
+
+Matt Trout
+Ash Berlin
+Amiri Barksdale
+
 =head1 LICENSE
 
 You may distribute this code under the same terms as Perl itself.

Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/view-deps/t/105view_deps.t
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/view-deps/t/105view_deps.t	2010-06-01 23:26:37 UTC (rev 9535)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/view-deps/t/105view_deps.t	2010-06-02 00:45:19 UTC (rev 9536)
@@ -28,7 +28,7 @@
     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' );
 
@@ -77,4 +77,22 @@
 
 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;

Modified: DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/view-deps/t/lib/ViewDeps/Result/Year2010CDsWithManyTracks.pm
===================================================================
--- DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/view-deps/t/lib/ViewDeps/Result/Year2010CDsWithManyTracks.pm	2010-06-01 23:26:37 UTC (rev 9535)
+++ DBIx-Class/0.08/branches/_abandoned_but_possibly_useful/view-deps/t/lib/ViewDeps/Result/Year2010CDsWithManyTracks.pm	2010-06-02 00:45:19 UTC (rev 9536)
@@ -8,7 +8,7 @@
 __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(
@@ -20,7 +20,7 @@
     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');




More information about the Bast-commits mailing list