debian man page for data::printer::filter::db

Query: data::printer::filter::db

OS: debian

Section: 3pm

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

Data::Printer::Filter::DB(3pm)				User Contributed Perl Documentation			    Data::Printer::Filter::DB(3pm)

NAME
Data::Printer::Filter::DB - pretty printing database objects
SYNOPSIS
In your program: use Data::Printer filters => { -external => [ 'DB' ], }; or, in your ".dataprinter" file: { filters => { -external => [ 'DB' ], };
DESCRIPTION
This is a filter plugin for Data::Printer. It filters through DBI's handlers (dbh) and statement (sth) objects displaying relevant information for the user. DBI is an extremely powerful and complete database interface. But it does a lot of magic under the hood, making their objects somewhat harder to debug. This filter aims to fix that :) For instance, say you want to debug something like this: use DBI; my $dbh = DBI->connect('dbi:DBM(RaiseError=1):', undef, undef ); A regular Data::Dumper output gives you absolutely nothing: $VAR1 = bless( {}, 'DBI::db' ); Data::Printer makes it better, but only to debug the class itself, not helpful at all to see its contents and debug your own code: DBI::db { Parents DBI::common Linear @ISA DBI::db, DBI::common public methods(48) : begin_work, clone, column_info, commit, connected, data_sources, disconnect, do, foreign_key_info, get_info, last_insert_id, ping, prepare, prepare_cached, preparse, primary_key, primary_key_info, quote, quote_identifier, rollback, rows, selectall_arrayref, selectall_hashref, selectcol_arrayref, selectrow_array, selectrow_arrayref, selectrow_hashref, sqlite_backup_from_file, sqlite_backup_to_file, sqlite_busy_timeout, sqlite_collation_needed, sqlite_commit_hook, sqlite_create_aggregate, sqlite_create_collation, sqlite_create_function, sqlite_enable_load_extension, sqlite_last_insert_rowid, sqlite_progress_handler, sqlite_register_fts3_perl_tokenizer, sqlite_rollback_hook, sqlite_set_authorizer, sqlite_update_hook, statistics_info, table_info, tables, take_imp_data, type_info, type_info_all private methods(0) internals: { } } Fear no more! If you use this filter, here's what you'll see: SQLite Database Handle (connected) { dbname: file.db Auto Commit: 1 Statement Handles: 0 Last Statement: - } Much better, huh? :) Statement handlers are even better. Imagine you continued your code with something like: my $sth = $dbh->prepare('SELECT * FROM foo WHERE bar = ?'); $sth->execute(42); With this filter, instead of an empty dump or full method information, you'll get exactly what you came for: 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.
SEE ALSO
Data::Printer perl v5.14.2 2011-05-30 Data::Printer::Filter::DB(3pm)
Related Man Pages
dbd::sponge(3pm) - linux
dbd::file(3) - suse
dbix::contextualfetch(3pm) - debian
data::printer::filter(3pm) - debian
data::printer::filter::db(3pm) - debian
Similar Topics in the Unix Linux Community
Local Printer Problems
Mac OS X 10.5.3: Printer drivers included in the HP Printer Driver Update v1.1.1
Steps for Installing a local Printer 310 -200
Steps for Installing a local Printer 310 -200
Printer is winning the battle! (for now)