DBIx::Class::QueryLog

Log queries for later analysis
Download

DBIx::Class::QueryLog Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Cory G Watson
  • Publisher web site:
  • http://search.cpan.org/~gphat/

DBIx::Class::QueryLog Tags


DBIx::Class::QueryLog Description

DBIx::Class::QueryLog is a Perl module that 'logs' each transaction and query executed so you can analyze what happened in the 'session'. It must be installed as the debugobj in DBIx::Class: use DBIx::Class::QueryLog; use DBIx::Class::QueryLog::Analyzer; my $schema = ... # Get your schema! my $ql = DBIx::Class::QueryLog->new; $schema->storage->debugobj($ql); $schema->storage->debug(1); ... # do some stuff! my $ana = DBIx::Class::QueryLog::Analyzer->new({ querylog => $ql }); my @queries = $ana->get_sorted_queries;Every transaction and query executed will have a corresponding Transaction and Query object stored in order of execution, like so: Query Query Transaction QueryThis array can be retrieved with the log method. Queries executed inside a transaction are stored inside their Transaction object, not inside the QueryLog directly.Product's homepage


DBIx::Class::QueryLog Related Software