initial basic collection test
[dbsrgits/DBIx-Data-Store-old.git] / lib / DBIx / Data / Stream / STH.pm
CommitLineData
65b76960 1package DBIx::Data::Stream::STH;
2
3use Moose;
4use Method::Signatures::Simple;
5
6has 'sth' => (is => 'ro', required => 1, clearer => '_clear_sth');
7
8method next {
9 my $sth = $self->sth;
10 return unless $sth;
11 # {Active} only means that there *may* be more results to fetch
12 if ($sth->{Active} and my @next = $self->sth->fetchrow_array) {
13 return \@next;
14 }
15 $sth->finish;
16 # prepare_cached might recycle it now we're finished so get rid of it
17 $self->_clear_sth;
18 return;
19}
20
21__PACKAGE__->meta->make_immutable;
22
231;