Retire DBIC/SqlMakerTest.pm now that SQLA::Test provides the same function
[dbsrgits/DBIx-Class.git] / t / count / prefetch.t
index 7bc4708..eb18236 100644 (file)
@@ -4,8 +4,7 @@ use warnings;
 use lib qw(t/lib);
 
 use Test::More;
-use DBICTest;
-use DBIC::SqlMakerTest;
+use DBICTest ':DiffSQL';
 
 my $schema = DBICTest->init_schema();
 
@@ -31,9 +30,9 @@ my $schema = DBICTest->init_schema();
             JOIN artist artist ON artist.artistid = cds.artist
           WHERE tracks.position = ? OR tracks.position = ?
           GROUP BY cds.cdid
-        ) count_subq
+        ) cds
     )',
-    [ map { [ 'tracks.position' => $_ ] } (1, 2) ],
+    [ map { [ { sqlt_datatype => 'int', dbic_colname => 'tracks.position' } => $_ ] } (1, 2) ],
   );
 }
 
@@ -63,9 +62,11 @@ my $schema = DBICTest->init_schema();
           WHERE ( genre.name = ? )
           GROUP BY genre.genreid
         )
-      count_subq
+      genre
     )',
-    [ [ 'genre.name' => 'emo' ] ],
+    [ [ { sqlt_datatype => 'varchar', sqlt_size => 100, dbic_colname =>  'genre.name' }
+        => 'emo' ]
+    ],
   );
 }
 
@@ -91,7 +92,7 @@ my $schema = DBICTest->init_schema();
         LEFT JOIN lyrics lyrics ON lyrics.track_id = tracks.trackid
       WHERE lyrics.lyric_id IS NULL AND (position = ? OR position = ?)
     )',
-    [ map { [ position => $_ ] } (1, 2) ],
+    [ map { [ { sqlt_datatype => 'int', dbic_colname => 'position' } => $_ ] } (1, 2) ],
   );
 }