very basic outline
[dbsrgits/DBIx-Data-Store.git] / lib / DBIx / Data / Stream / STH.pm
CommitLineData
54bed31b 1package DBIx::Data::Stream::STH;
2
3use strictures 1;
4
5sub new {
6 my $proto = shift;
7 bless({ %{$_[0]} }, ref($proto)||$proto);
8}
9
10sub _sth { shift->{sth} }
11
12sub _clear_sth { delete shift->{sth} }
13
14sub next {
15 my $sth = (my $self = shift)->_sth;
16 return unless $sth;
17 # {Active} only means that there *may* be more results to fetch
18 if ($sth->{Active} and my @next = $self->sth->fetchrow_array) {
19 my %next; @next{@{$self->_column_order}} = @next;
20 return \%next;
21 }
22 $sth->finish;
23 # prepare_cached might recycle it now we're finished so get rid of it
24 $self->_clear_sth;
25 return;
26}
27
281;