/[cvs]/nfo/perl/libs/Data/Storage.pm
ViewVC logotype

Diff of /nfo/perl/libs/Data/Storage.pm

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

revision 1.13 by joko, Tue Dec 17 21:54:12 2002 UTC revision 1.14 by joko, Thu Dec 19 16:27:59 2002 UTC
# Line 7  Line 7 
7  ############################################  ############################################
8  #  #
9  #  $Log$  #  $Log$
10    #  Revision 1.14  2002/12/19 16:27:59  joko
11    #  - moved 'sub dropDb' to Data::Storage::Handler::DBI
12    #
13  #  Revision 1.13  2002/12/17 21:54:12  joko  #  Revision 1.13  2002/12/17 21:54:12  joko
14  #  + feature when using Tangram:  #  + feature when using Tangram:
15  #    + what? each object created should delivered with a globally(!?) unique identifier (GUID) besides the native tangram object id (OID)  #    + what? each object created should delivered with a globally(!?) unique identifier (GUID) besides the native tangram object id (OID)
# Line 412  sub testDsn { Line 415  sub testDsn {
415    }    }
416  }  }
417    
 sub dropDb {  
   my $self = shift;  
   my $dsn = $self->{locator}->{dbi}->{dsn};  
   
   $logger->debug( __PACKAGE__ .  "->dropDb( dsn $dsn )" );  
   
   $dsn =~ s/database=(.+?);//;  
   my $database_name = $1;  
   
   my $ok;  
     
   if ( my $dbh = DBI->connect($dsn, '', '', {  
                                                       PrintError => 0,  
                                                       } ) ) {  
     if ($database_name) {  
       if ($dbh->do("DROP DATABASE $database_name;")) {  
         $ok = 1;  
       }  
     }  
   
     $dbh->disconnect();  
   
   }  
     
   return $ok;  
 }  
   
418  1;  1;
419  __END__  __END__
420    

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed