[Catalyst] Re: Catalyst::Plugin::DBIC::QueryLog

Matt S Trout dbix-class at trout.me.uk
Tue Sep 4 10:59:52 GMT 2007


On Tue, Sep 04, 2007 at 01:19:31AM +0000, Fayland Lam wrote:
> Matt S Trout wrote:
> >On Sat, Sep 01, 2007 at 04:08:09AM +0000, Fayland Lam wrote:
> >>hi, guys.
> >>
> >>since I can't touch Cory Watson by gphat at cpan.org <mailto:gphat at cpan.org>
> >>so I wonder if this module is fine?
> >
> >No, it's awful. There's no reason at all for this to be a plugin.
> >
> >I'd suggest you make it a mixin for Catalyst::Model::DBIC::Schema instead.
> 
> 
> but it depends on every request. it start at the sub prepare and end 
> before finalize_body. due to my limited knowledge, I'm not sure if it's 
> OK as a mixin for Catalyst::Model::DBIC::Schema

I'm sure it is.

You just have a per-request query log.

That's trivial with Catalyst::Component::InstancePerContext.
 
> >
> >(otherwise how do you deal with two DBIC models each with their own
> >querylog etc. etc.)
> 
> that's right. but there is more than one way to do it. :)

Yes, but yours is wrong.

We've documented this clearly in ExtendingCatalyst - if it doesn't need
to affect the request cycle, it shouldn't be a plugin.

Please send me an htpasswd line so I can set up Model::DBIC::Schema::QueryLog
dirs for you (or consider just submitting a patch to M::DBIC::Schema itself,
which I'd be happy to help with)

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/                    http://www.shadowcat.co.uk/ 



More information about the Catalyst mailing list