switch to hashref based for command args and results
[dbsrgits/DBIx-Data-Store-old.git] / lib / DBIx / Data / Stream / STH.pm
index 7a5e162..eb504ef 100644 (file)
@@ -5,12 +5,15 @@ use Method::Signatures::Simple;
 
 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