8 my $schema = DBICTest::init_schema();
12 my $rs = $cd = $schema->resultset("CD")->search({});
14 my $rs_title = $rs->get_column('title');
15 my $rs_year = $rs->get_column('year');
17 is($rs_title->next, 'Spoonful of bees', "next okay");
19 my @all = $rs_title->all;
20 cmp_ok(scalar @all, '==', 5, "five titles returned");
22 cmp_ok($rs_year->max, '==', 2001, "max okay for year");
23 is($rs_title->min, 'Caterwaulin\' Blues', "min okay for title");
25 cmp_ok($rs_year->sum, '==', 9996, "three artists returned");
27 my $psrs = $schema->resultset('CD')->search({},
29 '+select' => \'COUNT(*)',
33 ok(defined($psrs->get_column('count')), '+select/+as count');
35 $psrs = $schema->resultset('CD')->search({},
37 '+select' => [ \'COUNT(*)', 'title' ],
38 '+as' => [ 'count', 'addedtitle' ]
41 ok(defined($psrs->get_column('count')), '+select/+as arrayref count');
42 ok(defined($psrs->get_column('addedtitle')), '+select/+as title');