The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Data::Printer::Filter::DB - pretty-printing database objects (DBI, DBIx::Class, etc)

SYNOPSIS

In your .dataprinter file:

    filters = DB

You may also customize the look and feel with the following options:

    filter_db.expand_dbh = 1

    # you can even customize your themes:
    colors.filter_db_connected    = #00cc00
    colors.filter_db_disconnected = #cc0000

That's it!

DESCRIPTION

This is a filter plugin for Data::Printer that displays (hopefully) more relevant information on database objects than a regular dump.

Parsed Modules

DBI

If it's a database handle, for example, this filter may show you something like this:

    SQLite Database Handle (connected) {
        dbname: file.db
        Auto Commit: 1
        Statement Handles: 2 (1 active)
        Last Statement: SELECT * FROM some_table
    }

And if you have a statement handler like this (for example):

    my $sth = $dbh->prepare('SELECT * FROM foo WHERE bar = ?');
    $sth->execute(42);

    use DDP; p $sth;

This is what you'll get:

    SELECT * FROM foo WHERE bar = ?  (42)

Note that if your driver does not support holding of parameter values, you'll get a bindings unavailable message instead of the bound values.

DBIx::Class

SEE ALSO

Data::Printer