---
name: "DBIx::Class::Storage::DBI::Role::QueryCounter"
section: "3pm"
platform: "linux"
package: "libdbix-class-perl"
version: "0.08123-1"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/DBIx::Class::Storage::DBI::Role::QueryCounter"
---

# DBIx::Class::Storage::DBI::Role::QueryCounter(3pm)

Role to add a query counter

## 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.

### \_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.
