On Wed, May 30, 2012 at 6:29 PM, Bill Moseley <[email protected]> wrote:

> Aren't those for enhancing the debug object and logging from the app?
>

You're right of course.  I don't know of an out of the box solution, but
maybe you could consider a runtime applied role to the sql_maker?  Or to be
clear:

   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');

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.

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.
-- 
fREW Schmidt
http://blog.afoolishmanifesto.com
_______________________________________________
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]

Reply via email to