4 package CtrlO::DBIC::Cursor::RowCountStatistics;
5 use Class::Method::Modifiers;
7 use CtrlO::DBIC::Cursor::RowCountStatistics::Storage;
9 use parent 'DBIx::Class::Storage::DBI::Cursor';
11 our $VERSION = '0.000001'; # 0.0.1
12 $VERSION = eval $VERSION;
16 my ($class, $storage, @rest) = @_;
19 CtrlO::DBIC::Cursor::RowCountStatistics::Storage->new($storage),
26 $self->{_ctrlo_rcs_count}++
27 unless $self->{_done};
33 my @rows = $orig->(@_);
34 $self->_emit_query_complete(scalar(@rows));
38 before __finish_sth => sub {
40 my $sql = $self->sth->{Statement};
41 $self->_emit_query_complete($self->{_ctrlo_rcs_count} || 0);
44 sub _emit_query_complete {
45 my ($self, $count) = @_;
46 $self->storage->debugobj->query_complete(
48 $self->storage->_cached_sql,
49 # TODO pass bind params
50 ) if $self->storage->debug;
57 CtrlO::DBIC::Cursor::RowCountStatistics - Description goes here
65 r.sedlacek@shadowcat.co.uk
69 None yet - maybe this software is perfect! (ahahahahahahahahaha)
73 Copyright (c) 2015 the CtrlO::DBIC::Cursor::RowCountStatistics L</AUTHOR> and L</CONTRIBUTORS>
78 This library is free software and may be distributed under the same terms