/[webpac]/trunk/index_DBI.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 /trunk/index_DBI.pm

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

revision 49 by dpavlin, Sat Mar 22 23:40:14 2003 UTC revision 50 by dpavlin, Sun Jun 1 13:46:42 2003 UTC
# Line 17  sub new { Line 17  sub new {
17          my $self = {};          my $self = {};
18          bless($self, $class);          bless($self, $class);
19    
20          # FIX: config params          my $dbd = shift || die "need dbi_dbd= in [global] section of configuration file";
21          $self->{dbh} = DBI->connect("DBI:Pg:dbname=webpac","dpavlin","") || die $DBI::errstr;          my $dsn = shift || die "need dbi_dsn= in [global] section of configuration file";
22            my $user = shift || die "need dbi_user= in [global] section of configuration file";
23            my $passwd = shift || die "need dbi_passwd= in [global] section of configuration file";
24    
25            $self->{dbh} = DBI->connect("DBI:$dbd:$dsn",$user,$passwd) || die $DBI::errstr;
26          # begin transaction          # begin transaction
27          $self->{dbh}->begin_work || die $self->{dbh}->errstr();          $self->{dbh}->begin_work || die $self->{dbh}->errstr();
28    
# Line 181  sub close { Line 185  sub close {
185  # FIX  # FIX
186  print STDERR "creating ord for $table...\n";  print STDERR "creating ord for $table...\n";
187                          create_ord($table);                          create_ord($table);
188                            undef $sth_cache{$table."select"};
189                            undef $sth_cache{$table."insert"};
190                            undef $sth_cache{$table."update"};
191                  }                  }
192    
193                  $self->{dbh}->disconnect;                  $self->{dbh}->disconnect;

Legend:
Removed from v.49  
changed lines
  Added in v.50

  ViewVC Help
Powered by ViewVC 1.1.26