Matt S Trout > DBIx-Class-0.08100 > DBIx::Class::Storage::DBI::Role::QueryCounter

Download:
DBIx-Class-0.08100.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  11
Open  16
Stalled  11
View/Report Bugs
Source   Latest Release: DBIx-Class-0.08123

NAME ^

DBIx::Class::Storage::DBI::Role::QueryCounter - Role to add a query counter

SYNOPSIS ^

    my $query_count = $schema->storage->query_count;

DESCRIPTION ^

Each time the schema does a query, increment the counter.

ATTRIBUTES ^

This package defines the following attributes.

head2 _query_count

Is the attribute holding the current query count. It defines a public reader called 'query_count' which you can use to access the total number of queries that DBIC has run since connection.

METHODS ^

This module defines the following methods.

_query_start

override on the method so that we count the queries.

_increment_query_count

Used internally. You won't need this unless you enjoy messing with the query count.

AUTHORS ^

See DBIx::Class for more information regarding authors.

LICENSE ^

You may distribute this code under the same terms as Perl itself.

syntax highlighting: