has 'sth' => (is => 'ro', required => 1, clearer => '_clear_sth');
+has '_column_order' => (is => 'ro', required => 1, init_arg => 'column_order');
+
method next {
my $sth = $self->sth;
return unless $sth;
# {Active} only means that there *may* be more results to fetch
if ($sth->{Active} and my @next = $self->sth->fetchrow_array) {
- return \@next;
+ my %next; @next{@{$self->_column_order}} = @next;
+ return \%next;
}
$sth->finish;
# prepare_cached might recycle it now we're finished so get rid of it