[Dbix-class] Adding comments to generated queries

Bill Moseley moseley at hank.org
Wed May 30 23:29:53 GMT 2012


On Wed, May 30, 2012 at 10:23 AM, fREW Schmidt <frioux at gmail.com> wrote:

> On Wed, May 30, 2012 at 8:23 AM, David Cantrell <david at cantrell.org.uk>wr=
ote:
>
>> On Wed, May 30, 2012 at 06:03:52AM -0500, Bill Moseley wrote:
>>
>> > Of course, with DBIC it's a bit more difficult to define "where" a que=
ry
>> > comes from since it can get built in parts and doesn't get executed
>> until
>> > it's used.  Plus, we already have code that reports on "slow" queries
>> (or
>> > excessive queries) in a given web request.
>> >
>> > Still, Is there any existing module that would do something like this
>> this?
>> > I'm not sure what it would put in outside of a stack trace.
>>
>> You mean like this?
>>
>> http://search.cpan.org/~dcantrell/DBIx-Class-QueryLog-WithStackTrace-1.0/
>>
>
> Similarly:
> https://metacpan.org/module/FREW/DBIx-Class-UnicornLogger-0.001000/lib/DB=
Ix/Class/UnicornLogger.pm
>

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

I was asking about modifying the query sent to Postgresql so the comment
ends up in the Postgresql query log -- and then have it included in our
pgfouine reports to make tracking down the query easier.  At least that's
what was being asked about in that email circulating around my office.

Again, I just don't see how useful that would be considering most of our
result sets are built up in quite a few places before executing the query.
  Still, it might be useful to save something in the result set when it is
first created and include that as a comment so we can associate it with a
specific web request.

-- =

Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20120530/445=
3eb20/attachment.htm


More information about the DBIx-Class mailing list