/[A3C]/lib/A3C/SQL.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/A3C/SQL.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 219 by dpavlin, Sat Jun 21 11:01:35 2008 UTC revision 220 by dpavlin, Sun Jun 22 14:55:55 2008 UTC
# Line 4  use strict; Line 4  use strict;
4  use warnings;  use warnings;
5    
6  use base qw(Jifty::Object Class::Accessor::Fast);  use base qw(Jifty::Object Class::Accessor::Fast);
7  __PACKAGE__->mk_accessors( qw(query arguments dbh encoding) );  __PACKAGE__->mk_accessors( qw(query arguments dbh encoding duration) );
8    
9  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
10    use Time::HiRes qw/time/;
11    
12  =head1 NAME  =head1 NAME
13    
# Line 44  sub sth { Line 45  sub sth {
45          if ( ! $self->{_sth} ) {          if ( ! $self->{_sth} ) {
46                  my $dbh = $self->dbh || Jifty->handle->dbh;                  my $dbh = $self->dbh || Jifty->handle->dbh;
47                  my $sth = $dbh->prepare( $self->query ) or $dbh->errstr;                  my $sth = $dbh->prepare( $self->query ) or $dbh->errstr;
48                    my $t = time();
49                  if ( $self->arguments ) {                  if ( $self->arguments ) {
50                          Jifty->log->debug( $self->sql . ' arguments: ' . dump( $self->arguments ) );                          Jifty->log->debug( $self->sql . ' arguments: ' . dump( $self->arguments ) );
51                          $sth->execute( $self->arguments ) or die $dbh->errstr;                          $sth->execute( $self->arguments ) or die $dbh->errstr;
52                  } else {                  } else {
53                          $sth->execute or die $dbh->errstr;                          $sth->execute or die $dbh->errstr;
54                  }                  }
55                    $self->duration( time() - $t );
56                  $self->{_sth} = $sth;                  $self->{_sth} = $sth;
57          }          }
58    

Legend:
Removed from v.219  
changed lines
  Added in v.220

  ViewVC Help
Powered by ViewVC 1.1.26