return $new;
}
+=head2 as_query
+
+=over 4
+
+=item Arguments: none
+
+=item Return Value: [ $sql, @bind ]
+
+=back
+
+Returns the SQL query and bind vars associated with the invocant.
+
+=cut
+
+sub as_query { return shift->_resultset->as_query }
+
=head2 next
=over 4
);
}
-
1;
=head1 AUTHORS
use lib qw(t/lib);
use DBICTest;
-plan tests => 6;
+plan tests => 8;
my $schema = DBICTest->init_schema();
my $art_rs = $schema->resultset('Artist');
is_deeply( \@bind, [ [ rank => 2 ], [ name => 'Billy Joel' ] ] );
}
+my $rscol = $art_rs->get_column( 'charfield' );
+
+{
+ my $arr = $rscol->as_query;
+ my ($query, @bind) = @$arr;
+
+ is( $query, "SELECT me.charfield FROM artist me WHERE ( ( ( rank = ? ) AND ( name = ? ) ) )" );
+ is_deeply( \@bind, [ [ rank => 2 ], [ name => 'Billy Joel' ] ] );
+}
+
__END__