8 my $schema = DBICTest->init_schema();
13 my $rs = $cd = $schema->resultset("CD")->search({});
15 my $rs_title = $rs->get_column('title');
16 my $rs_year = $rs->get_column('year');
18 is($rs_title->next, 'Spoonful of bees', "next okay");
20 my @all = $rs_title->all;
21 cmp_ok(scalar @all, '==', 5, "five titles returned");
23 cmp_ok($rs_year->max, '==', 2001, "max okay for year");
24 is($rs_title->min, 'Caterwaulin\' Blues', "min okay for title");
26 cmp_ok($rs_year->sum, '==', 9996, "three artists returned");
28 my $psrs = $schema->resultset('CD')->search({},
30 '+select' => \'COUNT(*)',
34 ok(defined($psrs->get_column('count')), '+select/+as count');
36 $psrs = $schema->resultset('CD')->search({},
38 '+select' => [ \'COUNT(*)', 'title' ],
39 '+as' => [ 'count', 'addedtitle' ]
42 ok(defined($psrs->get_column('count')), '+select/+as arrayref count');
43 ok(defined($psrs->get_column('addedtitle')), '+select/+as title');
46 my $rs = $schema->resultset("CD")->search({}, { prefetch => 'artist' });
47 my $rsc = $rs->get_column('year');
48 is( $rsc->{_parent_resultset}->{attrs}->{prefetch}, undef, 'prefetch wiped' );