Re: Using DBI::Profile to count and time database calls

2014-10-08 Thread Bill Moseley
Noting like writing an email to trigger reading the docs again. On Tue, Oct 7, 2014 at 11:43 AM, Bill Moseley wrote: > I'm trying to just count number of database queries and the time spent > waiting on the database. > Does this look correct? my $h = DBI::Profile->new( Path

Using DBI::Profile to count and time database calls

2014-10-08 Thread Bill Moseley
that go to the db (e.g. "execute", "do"). Can I use DBI::Profile to just gather up counts to the database? Thanks, -- Bill Moseley mose...@hank.org

Re: Numeric and string columns.

2011-02-26 Thread Bill Moseley
ght be helpful to note in the README that DBI_USER will default to 'postgres' if not set. (Don't many distributions use that as the superuser and it is probably not available for most normal users?) -- Bill Moseley mose...@hank.org

Numeric and string columns.

2011-02-25 Thread Bill Moseley
ot;2010"} Notice how the deleted boolean and integer columns are quoted, but the "foo" I injected is not quoted? In a javascript library we are using it's seeing the deleted value as true. So, I'm curious if I can make DBI (or DBD::Pg) return the non-text columns looking like numbers to Perl. I suppose I could do something silly like: /^\d+$/ && ($_ += 0) for values %{$x}; which then returns: {"artist":1,"name":"One first CD","foo":0,"deleted":0,"id":1,"year":2010} -- Bill Moseley mose...@hank.org

$DBI::neat_maxlen

2010-02-04 Thread Bill Moseley
$DBI::neat_maxlen = 1; DBI->trace(1); <- connect('dbname=test_dev', 'moseley', ...)= DBI::db=HASH(0xb2f6a90) at DBI.pm line 653 Anyway to show the full connect details? $DBI::VERSION = "1.609"; -- Bill Moseley mose...@hank.org

Re: persistent dbi handles

2009-10-21 Thread Bill Moseley
$dbh and then create a new $dbh. Then wrap the request in eval block and rollback on errors. Or maybe try this: http://search.cpan.org/~dwheeler/DBIx-Connector-0.20/lib/DBIx/Connector.pm -- Bill Moseley mose...@hank.org

Re: Master / Slave driver?

2009-07-10 Thread Bill Moseley
. True. That's perhaps a bit easier to control since we are the ones creating the functions. But I do see your point. Thanks, -- Bill Moseley mose...@hank.org

Re: Master / Slave driver?

2009-07-08 Thread Bill Moseley
On Mon, Jul 6, 2009 at 10:26 PM, Jared Still wrote: > > On Mon, Jun 29, 2009 at 7:59 PM, Bill Moseley wrote: > >> What solutions are available, if any, to work with a master and multiple >> slave database configuration that would be transparent to the application? >&g

Master / Slave driver?

2009-06-29 Thread Bill Moseley
Postgresql. Thanks, -- Bill Moseley mose...@hank.org

Re: $DBI::neat_maxlen and execute() and debugging

2009-05-08 Thread Bill Moseley
per \...@_; return; }, } qw/ prepare prepare_cached execute quote_identifier * /; my $dbh = DBI->connect( 'dbi:Pg:', '', '', { RaiseError => 1, AutoCommit => 1, Callbacks => \%callbacks, }, ); my $sth

Re: $DBI::neat_maxlen and execute() and debugging

2009-05-07 Thread Bill Moseley
ch.perl.org/src/TIMB/DBI-1.608/t/70callbacks.t I was looking at the callbacks a few days ago. I wasn't clear what all was available, but more importantly I couldn't see if it was possible to also get the execute parameters. I assume it's not possible with the callbacks. Is that c

$DBI::neat_maxlen and execute() and debugging

2009-05-07 Thread Bill Moseley
trace to be able to selectively trace some statements based on inspecting what caller() returns. Does DBI have any existing hooks for doing this? What I want to see is everything passed to the database. I can see this in the database logs but I want to filter and add extra info based on caller().

Re: escaping % AND \%

2007-06-29 Thread Bill Moseley
t; right? The \\% is translated to: % Which leaves the % unescaped. I'll just remove "\" from the input. But thought this might be a reasonably common situation (use % around a search string but not allow % or _ to be special in the user data. -- Bill Moseley [EMAIL PROTECTED]

Re: escaping % AND \%

2007-06-29 Thread Bill Moseley
ight? So \\% is what > you'd want, isn't it? No, I don't want to give the user access to the % or _. I'm using '%' . $user_string . '%' but I don't want $user_string to have any special characters. If $user_string includes \ or % or _ I want them to be literal, without special meaning. -- Bill Moseley [EMAIL PROTECTED]

escaping % AND \%

2007-06-29 Thread Bill Moseley
But if $search_pattern is '\%' then you end up with '\\%'. I suppose the easy thing is to s/$esc//g first. What's the approach if the $esc is a valid character for the column data? -- Bill Moseley [EMAIL PROTECTED]

connect_cached resets %attr to defaults?

2007-05-22 Thread Bill Moseley
like attributes are reset when connect_cached is called. I guess that's why Ima::DBI doesn't call connect_cached() unless ping fails. -- Bill Moseley [EMAIL PROTECTED]

Column names when using selectall_arrayref

2006-05-03 Thread Bill Moseley
a in the column order specified in the query. And also return the list of column names. Thanks, -- Bill Moseley [EMAIL PROTECTED]

Re: How to change how much trace truncates?

2006-03-16 Thread Bill Moseley
On Sat, Feb 11, 2006 at 01:22:49PM +, Tim Bunce wrote: > On Fri, Feb 10, 2006 at 02:50:11PM -0800, Bill Moseley wrote: > > I'd like to see all of the prepared_cached() and execute() statements > > when tracing. Currently that output is truncated. > > > > Ho

How to change how much trace truncates?

2006-02-10 Thread Bill Moseley
I'd like to see all of the prepared_cached() and execute() statements when tracing. Currently that output is truncated. How do I change where it truncates? Thanks, -- Bill Moseley [EMAIL PROTECTED]

Re: Open cursors after disconnection

2001-12-06 Thread Bill Moseley
t a good use of heavy mod_perl processes. Bill Moseley mailto:[EMAIL PROTECTED]

Generic add/update/delete/list script

2001-10-30 Thread Bill Moseley
Hi, I've found a number of generic CGI scripts for simple table operations, but nothing great. Is there one that's well-coded, where I can simply specify the the column data types, and validation routines and be done? In a perfect world it would be Template-Toolkit based, too. Tha