---
name: "Jifty::Plugin::SQLQueries"
section: "3pm"
platform: "linux"
package: "libjifty-perl"
version: "1.10518+dfsg-2"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/Jifty::Plugin::SQLQueries"
---

# Jifty::Plugin::SQLQueries(3pm)

Inspect your application's SQL queries

## NAME

Jifty::Plugin::SQLQueries - Inspect your application's SQL queries

## DESCRIPTION

This plugin will log each SQL query, its duration, its bind parameters, and its stack trace. Such reports are available at:

```
    http://your.app/__jifty/admin/requests
```

## USAGE

Add the following to your site\_config.yml

```
 framework:
   Plugins:
     - SQLQueries: {}
```

You can turn on and off the stacktrace, as well as an "EXPLAIN" of each query, using options to the plugin:

```
 framework:
   Plugins:
     - SQLQueries:
         stacktrace: 0
         explain: 1
```

The plugin defaults to logging the stack trace, but not the explain.

## METHODS

### init

Sets up a "post\_init" hook.

### inspect\_before\_request

Clears the query log so we don't log any unrelated previous queries.

### inspect\_after\_request

Stash the query log.

### inspect\_render\_summary

Display how many queries and their total time.

### inspect\_render\_analysis

Render a template with all the detailed information.

### post\_init

Tells Jifty::DBI to log queries in a way that records stack traces.

### prereq\_plugins

This plugin depends on Jifty::Plugin::RequestInspector.

## COPYRIGHT AND LICENSE

Copyright 2007-2010 Best Practical Solutions

This is free software and may be modified and distributed under the same terms as Perl itself.
