remove unnecessary sth inspection since _emit_query_complete will use the storage...
[dbsrgits/DBIx-Class-RowCountStatistics.git] / lib / CtrlO / DBIC / Cursor / RowCountStatistics.pm
index 1e3221d..3edfd95 100644 (file)
@@ -37,7 +37,7 @@ around all => sub {
 
 before __finish_sth => sub {
     my ($self) = @_;
-    my $sql = $self->sth->{Statement};
+
     $self->_emit_query_complete($self->{_ctrlo_rcs_count} || 0);
 };
 
@@ -55,26 +55,50 @@ sub _emit_query_complete {
 
 =head1 NAME
 
-CtrlO::DBIC::Cursor::RowCountStatistics - Description goes here
+CtrlO::DBIC::Cursor::RowCountStatistics - Provide row-count statistics
 
 =head1 SYNOPSIS
 
+    my $schema = Schema->connect(
+        $dsn, $username, $password,
+        {},
+        { cursor_class => 'CtrlO::DBIC::Cursor::RowCountStatistics' },
+    );
+
 =head1 DESCRIPTION
 
+This L<DBIx::Class::Storage::DBI::Cursor> subclass allows you to log the
+number of rows that were fetched through the cursor.
+
+B<Warning>: This module currently lies on L<DBIx::Class> internals and
+might break with an update.
+
+=head1 DEBUG OBJECT METHODS
+
+=head2 query_complete (optional)
+
+If available on the L<DBIx::Class::Storage/debugobj>, this method will be
+called with the following signature:
+
+    sub query_complete {
+        my ($self, $row_count, $sql, @bind_values) = @_;
+        ...
+    }
+
+B<Note>: The passing of the C<@bind_values> is currently not yet
+implemented, and no values will be passed yet.
+
 =head1 AUTHOR
 
  r.sedlacek@shadowcat.co.uk
 
 =head1 CONTRIBUTORS
 
-None yet - maybe this software is perfect! (ahahahahahahahahaha)
+None yet.
 
 =head1 COPYRIGHT
 
 Copyright (c) 2015 the CtrlO::DBIC::Cursor::RowCountStatistics L</AUTHOR> and L</CONTRIBUTORS>
 as listed above.
 
-=head1 LICENSE
-
-This library is free software and may be distributed under the same terms
-as perl itself.
+=cut