done_testing;
+my $artist_src = $schema->resultset('Artist')->result_source;
+
my $q = $schema->resultset('CD')->search({}, { columns => [qw/artist year/], group_by => 'artist' })->as_query;
-#p $q;
-#diag Dumper($q);
-#p $schema->resultset('Artist')->result_source;
-#p Dumper $q;
my $count = 0;
my $name = "zaaaaa";
-$schema->storage->insert_bulk($schema->resultset('Artist')->result_source, [qw/name rank/], [[[qw/foo 1/], [qw/baz 2/]], sub {
+
+$schema->storage->insert_bulk($artist_src, [qw/name rank/], [[[qw/foo 1/], [qw/baz 2/]], sub {
return [$name++, ++$count] unless $count > 5;
return undef;
}, $q, [[qw/asdf 5/], [qw/uhiuh 6/]]]);