FAQ
I'm trying to see the queries the actual query code that is submitted to the database when I perform a find on a model.

I've tried:

1) Adding $ENV{DBIC_TRACE}++ to the MyApp.pm
2) Setting the Windows7 Environment variable DBIC_TRACE to 1
3) Setting my run configuration in Eclispe with the arguments -d -r AND Environment DBIC_TRACE = 1

Each time I run the myapp_server.pl -d -r it does not show the query executed.


Ideally Executing :

$c->model("MyDatabase::UserAccount")->find({ realm => $c->user->auth_realm, key => $c->user->url });

Would show the query below in STDOUT

SELECT * FROM UserAccount where realm = '<user realm>' AND key ='<user url>';

I'm running in a windows environment with strawberry perl and using Eclipse.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20101201/8011c474/attachment.htm

Search Discussions

  • Blaine Everingham at Dec 1, 2010 at 11:03 pm
    I'm trying to see the queries the actual query code that is submitted to the database when I perform a find on a model.

    I've tried:

    1) Adding $ENV{DBIC_TRACE}++ to the MyApp.pm
    2) Setting the Windows7 Environment variable DBIC_TRACE to 1
    3) Setting my run configuration in Eclispe with the arguments -d -r AND Environment DBIC_TRACE = 1

    Each time I run the myapp_server.pl -d -r it does not show the query executed.


    Ideally Executing :

    $c->model("MyDatabase::UserAccount")->find({ realm => $c->user->auth_realm, key => $c->user->url });

    Would show the query below in STDOUT

    SELECT * FROM UserAccount where realm = '<user realm>' AND key ='<user url>';

    I'm running in a windows environment with strawberry perl and using Eclipse.

    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20101201/cb44aa22/attachment.htm
  • Marilyn Burgess at Dec 1, 2010 at 11:16 pm

    On linux I start the server with:

    DBIC_TRACE=1 myapp_server.pl -r
    which does the trick. Not sure if the same will work under windows.

    Marilyn

    On Wed, Dec 1, 2010 at 3:03 PM, Blaine Everingham wrote:

    I'm trying to see the queries the actual query code that is submitted to
    the database when I perform a find on a model.

    I've tried:

    1) Adding $ENV{DBIC_TRACE}++ to the MyApp.pm
    2) Setting the Windows7 Environment variable DBIC_TRACE to 1
    3) Setting my run configuration in Eclispe with the arguments -d -r AND
    Environment DBIC_TRACE = 1

    Each time I run the myapp_server.pl -d -r it does not show the query
    executed.


    Ideally Executing :

    $c->model("MyDatabase::UserAccount")->find({ realm =>
    $c->user->auth_realm, key => $c->user->url });

    Would show the query below in STDOUT

    SELECT * FROM UserAccount where realm = '<user realm>' AND key ='<user
    url>';

    I'm running in a windows environment with strawberry perl and using
    Eclipse.

    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20101201/a9b59a36/attachment.htm
  • Blaine Everingham at Dec 1, 2010 at 11:29 pm
    Thanks Marilyn,
    You got me thinking that maybe it was a runtime issue with the Perl Interpreter running through Eclipse.
    Anyhow, when I run the myapp_server.pl from the windows command prompt I see the queries.
    Blaine

    Date: Wed, 1 Dec 2010 15:16:23 -0800
    Subject: Re: [Catalyst] Catalyst::Model::DBIC::Schema - Print Debug statement
    From: marilyn@marilynburgess.com
    To: catalyst@lists.scsys.co.uk

    On linux I start the server with:
    DBIC_TRACE=1 myapp_server.pl -r

    which does the trick. Not sure if the same will work under windows.
    Marilyn

    On Wed, Dec 1, 2010 at 3:03 PM, Blaine Everingham wrote:






    I'm trying to see the queries the actual query code that is submitted to the database when I perform a find on a model.

    I've tried:

    1) Adding $ENV{DBIC_TRACE}++ to the MyApp.pm
    2) Setting the Windows7 Environment variable DBIC_TRACE to 1

    3) Setting my run configuration in Eclispe with the arguments -d -r AND Environment DBIC_TRACE = 1

    Each time I run the myapp_server.pl -d -r it does not show the query executed.



    Ideally Executing :

    $c->model("MyDatabase::UserAccount")->find({ realm => $c->user->auth_realm, key => $c->user->url });

    Would show the query below in STDOUT


    SELECT * FROM UserAccount where realm = '<user realm>' AND key ='<user url>';

    I'm running in a windows environment with strawberry perl and using Eclipse.


    _______________________________________________

    List: Catalyst@lists.scsys.co.uk

    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst

    Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/

    Dev site: http://dev.catalyst.perl.org/





    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20101201/bdbb4925/attachment.htm
  • Eden Cardim at Dec 3, 2010 at 12:47 pm
    "Blaine" == Blaine Everingham writes:
    Blaine> I'm trying to see the queries the actual query code that is
    Blaine> submitted to the database when I perform a find on a model.
    Blaine> I've tried:

    Blaine> 1) Adding $ENV{DBIC_TRACE}++ to the MyApp.pm

    You need to set it before the storage object is constructed, namely,
    it should work if you place it before the call to MyApp->setup

    --
    Eden Cardim Need help with your perl Catalyst or DBIx::Class project?
    Software Engineer http://www.shadowcat.co.uk/catalyst/
    Shadowcat Systems Ltd. Want a managed development or deployment platform?
    http://blog.edencardim.com http://www.shadowcat.co.uk/servers/

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedDec 1, '10 at 11:01p
activeDec 3, '10 at 12:47p
posts5
users3
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2021 Grokbase