On Wed, May 30, 2012 at 9:09 PM, fREW Schmidt <[email protected]> wrote:
>
> package MyApp::TraitFor::SQLMaker::CommentLogs;
>
> use Moo::Role;
>
> around select => sub { ... };
>
> 1;
>
> ...
>
> use Role::Tiny;
> Role::Tiny->apply_roles_to_object($schema->storage->sql_maker,
> 'MyApp::TraitFor::SQLMaker::CommentLogs');
>
Thanks, that's helpful. And something good to know about in general.
> Of course, you'll need to put the stack trace somewhere to get jammed into
> the sql. I have no idea when or where you'll want to do that, but it's
> certainly feasible.
>
Well the "problem" that apparently needs to get solved is to simply find
the code that generated a specific query seen in the Postgresql query log.
I guess there's been a few times when Postgresql gets hammered in
production and it hasn't been easy to find the code generating a specific
query. (Sounds like a QA/testing problem, though.) Maybe the URI
requested or Catalyst action name might be enough of a comment to help
track it back to the app.
> Also note: this is getting very much into dangerous territory. If you do
> this make sure you write a lot of tests as this is something that is not
> quite encouraged and thus only tenuously supported.
>
That's more supportive of this idea than I would be. :)
Thanks,
--
Bill Moseley
[email protected]
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]