ANNOUNCE: Apache-Status-DBI-v1.0.0.tar.gz



file: $CPAN/authors/id/T/TI/TIMB/Apache-Status-DBI-v1.0.0.tar.gz
size: 4562 bytes
md5: 15e92e4c765793ae850191f9b02e8d83

I needed an Apache::Status plugin to show all DBI connections and statements.
I couldn't see one so I wrote one...

It uses the fact that DBI (>= 1.49) now keeps weak refs to child handles,
so it's possible to drill-down through every DBI handle that exists.

I've appended a sample of the output. (It's copied from the web page so
has lost the bolding and dimming that the real output uses in places.)

Enjoy!

Tim.

----------------------------------------------------------------------------------------------------------
DBI 1.55 - Drivers, Connections and Statements

4 drivers loaded: DBM, Sponge, ExampleP, Gofer

----------------------------------------------------------------------------------------------------------
DBD::DBM version 0.03, 2 dbh (2 cached, 2 active) DBI::dr=HASH(0x18f3010)

DSN "dbm_type=SDBM_File;lockfile=0" DBI::db=HASH(0x193e374)
Attributes: Active, Executed, RaiseError, ShowErrorStatement, AutoCommit
Attributes: ErrCount=1, TraceLevel=0, FetchHashKeyName='NAME', LongReadLen=80, Username=undef
Statement: SELECT dKey, dVal FROM fruit

DSN "dbm_type=SDBM_File;mldbm=;lockfile=0;f_dir=/Users/timbo/dbi/trunk/test_output" DBI::db=HASH(0x192256c)
Attributes: Active, Executed, RaiseError, ShowErrorStatement, AutoCommit
Attributes: ErrCount=0, TraceLevel=0, FetchHashKeyName='NAME', LongReadLen=80, Username=undef
Statement: DELETE FROM SDBM_File_fruit WHERE dVal='to delete'

----------------------------------------------------------------------------------------------------------
DBD::ExampleP version 12.009153, 5 dbh (5 cached, 5 active) DBI::dr=HASH(0x18a6bc4)

DSN "." DBI::db=HASH(0x18f0b18)
Attributes: Active, RaiseError, AutoCommit
Attributes: ErrCount=0, TraceLevel=0, FetchHashKeyName='NAME', LongReadLen=80, Username=undef

DSN "" DBI::db=HASH(0x18ef52c)
Attributes: Active, Executed, RaiseError, AutoCommit
Attributes: ErrCount=3, TraceLevel=0, FetchHashKeyName='NAME', LongReadLen=80, Username=''
Statement: SELECT name FROM t
sth: 1 (1 cached, 0 active)

sth DBI::st=HASH(0x195ec00)
Attributes: Executed, RaiseError
Attributes: ErrCount=0, TraceLevel=0, FetchHashKeyName='NAME', LongReadLen=80
Statement: select name from ?
ParamValues: 1='.'
Attributes: NUM_OF_PARAMS=1, NUM_OF_FIELDS=1, CursorName=undef
Rows: 40

----------------------------------------------------------------------------------------------------------

Tim.
.



Relevant Pages

  • Apache::Status plugin to show all DBI connections and statements
    ... I needed an Apache::Status plugin to show all DBI connections and statements. ... has lost the bolding and dimming that the real output uses in places.) ... sth: ...
    (perl.dbi.users)
  • selectall_arrayref/hashref error again
    ... I'm wondering about how to retrieve the error from bad sql passed to ... discover if the data is complete or was truncated due to an ... RaiseError without a $sth, it would be nice if the doc would just say ... I'm using perl 5.8.7 and DBI 1.50 ...
    (perl.dbi.users)
  • Questions about connectivity
    ... I'd really like to get some comfirmation about how DBI and it's associated $dbh and $sth objects should work. ... I stop the mysql Server I've connected to. ... The above script is running from a command line, so there isn't any DBI caching going on. ...
    (perl.dbi.users)
  • Re: last insert id
    ... Ron Savage wrote: ... DBI: V 1.47 ... else # Oracle. ... $sth -> execute; ...
    (perl.dbi.users)
  • DBI and fetchrow
    ... Does anyone know why this script hangs when it's executed? ... is there a good 'DBI with SQL with Perl' book out there? ... use vars qw; ... my $sth = $dbh->prepare; ...
    (perl.beginners)