In 'hand-written' apps I normally dump SQL statements to file, together with timing data from Time::HiRes. DBIC seems to support several ways of doing this using the debugobj eg DBIx::Class::Storage::Statistics and DBIx::Class::QueryLog.

I would like to use the latter, but have no idea how to set the debugobj. According to the DBIC::QueryLog doc:

my $schema = ... # Get your schema!
my $ql = new DBIx::Class::QueryLog();
$schema->storage->debugobj($ql);
$schema->storage->debug(1);
... # do some stuff!

Trying various places to set debugobj so far has failed with error messages, usually relating to storage. In reality I've no idea where to start with this. The intuitive place to set the debugobj is either MyApp/lib/Schema.pm or MyApp::Model::Schema.pm, but neither seems to work. Presumably I shouldn't be doing this in the MyApp/lib/Schema DBIC classes? A simple code example is really all I need to get going.
--
Richard Jones
Leeds, UK

**********************************************************************
Information in this message  may contain  confidential and  privileged
information.  If you are not  the intended recipient please accept our
apologies; please do not disclose,  copy or distribute  information in
this e-mail or take any  action in reliance on its  contents: to do so
is strictly prohibited and may be unlawful. Please inform us that this
message  has  gone  astray  before  deleting it.  Thank  you for  your
co-operation.

NHSmail is used daily by over 100,000 staff in the NHS. Over a million
messages  are sent every day by the system.  To find  out why more and
more NHS personnel are  switching to  this NHS  Connecting  for Health
system please visit www.connectingforhealth.nhs.uk/nhsmail **********************************************************************


_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to