1 package DBIx::Class::Storage::DBI::Cursor;
3 use base qw/DBIx::Class::Cursor/;
9 my ($it_class, $sth, $args, $attrs) = @_;
10 #use Data::Dumper; warn Dumper(@_);
11 $it_class = ref $it_class if ref $it_class;
17 return bless ($new, $it_class);
22 return if $self->{attrs}{rows}
23 && $self->{pos} >= $self->{attrs}{rows}; # + $self->{attrs}{offset});
24 my $sth = $self->{sth};
25 unless ($self->{live_sth}) {
26 $sth->execute(@{$self->{args} || []});
27 $self->{live_sth} = 1;
29 my @row = $sth->fetchrow_array;
30 $self->{pos}++ if @row;
36 return $self->SUPER::all if $self->{attrs}{rows};
37 my $sth = $self->{sth};
38 $sth->finish if $sth->{Active};
39 $sth->execute(@{$self->{args} || []});
40 delete $self->{live_sth};
41 return @{$sth->fetchall_arrayref};
46 $self->{sth}->finish if $self->{sth}->{Active};
48 $self->{live_sth} = 0;
54 $self->{sth}->finish if $self->{sth}->{Active};