our $VERSION = '0.000001'; # 0.0.1
$VERSION = eval $VERSION;
+# Wrap the original ::Storage::DBI we received so we can extract data
+# from it's usage by the Cursor.
around new => sub {
my $orig = shift;
my ($class, $storage, @rest) = @_;
+
return $orig->(
$class,
CtrlO::DBIC::Cursor::RowCountStatistics::Storage->new($storage),
around all => sub {
my $orig = shift;
my ($self) = @_;
+
my @rows = $orig->(@_);
+
+ # ->all does its own finalization, so we fire the complete event
+ # right here.
$self->_emit_query_complete(scalar(@rows));
return @rows;
};
sub _emit_query_complete {
my ($self, $count) = @_;
+
$self->storage->debugobj->query_complete(
$count,
$self->storage->_cached_sql,