1 package DBIx::Class::Cursor;
7 my ($it_class, $sth, $args, $attrs) = @_;
8 #use Data::Dumper; warn Dumper(@_);
9 $it_class = ref $it_class if ref $it_class;
15 return bless ($new, $it_class);
20 return if $self->{attrs}{rows}
21 && $self->{pos} >= $self->{attrs}{rows}; # + $self->{attrs}{offset});
22 unless ($self->{live_sth}) {
23 $self->{sth}->execute(@{$self->{args} || []});
24 if (my $offset = $self->{attrs}{offset}) {
25 $self->{sth}->fetch for 1 .. $offset;
27 $self->{live_sth} = 1;
29 my @row = $self->{sth}->fetchrow_array;
30 $self->{pos}++ if @row;
36 $self->{sth}->finish if $self->{sth}->{Active};
38 $self->{live_sth} = 0;
44 $self->{sth}->finish if $self->{sth}->{Active};