[Catalyst] Re: sql debugging hooks
Ash Berlin
ash_cpan at firemirror.com
Sat Jul 11 19:06:37 GMT 2009
On 11 Jul 2009, at 19:47, Minty wrote:
>> But I want to inject my $debugger via the Model or schema, and
>> enable/disable it globablly via a configuration file flag.
>
> What I meant to say was I want to inject my custom debugobj handler
> globally (at least in development), then simplify the code in the
> Controllers to just:
>
> $model->result_source->storage->debug(1);
> my $employee = $mode->find(123);
> $model->result_source->storage->debug(0);
>
> When I want to debug that one particular query.
>
See http://search.cpan.org/perldoc?Catalyst::Model::DBIC::Schema::QueryLog
and http://search.cpan.org/perldoc?Catalyst::TraitFor::Model::DBIC::Schema::QueryLog
.
That includes a TT snippet you can (conditionally) put in your
wrapper, or you could produce something similar for console output
-ash
More information about the Catalyst
mailing list