--- trunk/lib/SQLSession/Action/DoSQL.pm 2007/01/25 19:55:30 65 +++ trunk/lib/SQLSession/Action/DoSQL.pm 2007/01/25 20:28:42 66 @@ -12,6 +12,7 @@ use SQLSession::Model::DatabaseCollection; use DBI; +use Time::HiRes qw/time/; use Data::Dump qw/dump/; @@ -109,16 +110,18 @@ warn "SQL: $sql\n"; + my $t = time(); + my $sth = $dbh->prepare( $sql ) || $self->result->error( $dbh->errstr() ) && return 0; $sth->execute() || $self->result->error( $sth->errstr() ) && return 0; - $self->result->message('Query produced ' . ( + $self->result->message('Query produced ' . ( $sth->rows == 0 ? 'no results' : $sth->rows == 1 ? 'single row' : - $sth->rows . ' rows' + sprintf("%d rows in %.2fs", $sth->rows, time() - $t) )) if ($sth->rows >= 0); $self->result->content( sth => $sth );