[Bio] / Sprout / ERDBLoad.pm Repository:
ViewVC logotype

Diff of /Sprout/ERDBLoad.pm

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

revision 1.10, Mon Jan 30 21:52:04 2006 UTC revision 1.15, Fri Jul 7 00:24:50 2006 UTC
# Line 28  Line 28 
28    
29  =head3 new  =head3 new
30    
31  C<< my $erload = ERDBLoad->new($erdb, $relationName, $directory); >>  C<< my $erload = ERDBLoad->new($erdb, $relationName, $directory, $loadOnly, $ignore); >>
32    
33  Begin loading an ERDB relation.  Begin loading an ERDB relation.
34    
# Line 83  Line 83 
83          $fileHandle = "";          $fileHandle = "";
84      } else {      } else {
85          # If this is a primary entity relation, sort the output to remove          # If this is a primary entity relation, sort the output to remove
86          # duplicate keys.          # duplicate keys and make the load more efficient.
87          my $fileString = ($erdb->IsEntity($relationName) ?          my $fileString = ($erdb->SortNeeded($relationName) ?
88                              "| sort +0 -1 -u -t \"\t\" >$fileName" :                              "| sort +0 -1 -u -t \"\t\" >$fileName" :
89                              ">$fileName");                              ">$fileName");
90          # Open the output file and remember its handle.          # Open the output file and remember its handle.
# Line 110  Line 110 
110    
111  =head3 Ignore  =head3 Ignore
112    
113  C<< my $flag = $erload->Ignore(); >>  C<< my $flag = $erload->Ignore; >>
114    
115  Return TRUE if we are ignoring this table, else FALSE.  Return TRUE if we are ignoring this table, else FALSE.
116    
# Line 147  Line 147 
147      my ($self, @rawFields) = @_;      my ($self, @rawFields) = @_;
148      # Only proceed if we're not ignoring.      # Only proceed if we're not ignoring.
149      if (! $self->{ignore}) {      if (! $self->{ignore}) {
150            # Convert the hash-string fields to their digested value.
151            $self->{dbh}->DigestFields($self->{relName}, \@rawFields);
152          # Insure the field values are okay.          # Insure the field values are okay.
153          my $truncates = $self->{dbh}->VerifyFields($self->{relName}, \@rawFields);          my $truncates = $self->{dbh}->VerifyFields($self->{relName}, \@rawFields);
154          # Run through the list of field values, escaping them.          # Run through the list of field values, escaping them.
# Line 207  Line 209 
209    
210  C<< my $stats = $erload->Finish(); >>  C<< my $stats = $erload->Finish(); >>
211    
212  Finish loading the table. This closes the load file and loads its contents into the database.  Finish loading the table. This closes the load file.
 It also creates the indexes if the DBMS uses post-indexing.  
213    
214  =over 4  =over 4
215    

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.15

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3