[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.11, Mon Jan 30 21:56:50 2006 UTC revision 1.18, Mon Jul 10 09:06:46 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 82  Line 82 
82          Trace("Relation $relationName will be loaded from $fileName.") if T(2);          Trace("Relation $relationName will be loaded from $fileName.") if T(2);
83          $fileHandle = "";          $fileHandle = "";
84      } else {      } else {
85          # If this is a primary entity relation, sort the output to remove          # Determine the sort for this relation.
86          # duplicate keys.          my $fileString = "| " . $erdb->SortNeeded($relationName) . " >$fileName";
87          my $fileString = ($erdb->IsEntity($relationName) ?          Trace("Load file creation string is \"$fileString\".") if T(3);
                             "| sort +0 -1 -u -t \"\t\" >$fileName" :  
                             ">$fileName");  
88          # Open the output file and remember its handle.          # Open the output file and remember its handle.
89          $fileHandle = Open(undef, $fileString);          $fileHandle = Open(undef, $fileString);
90          Trace("Relation $relationName load file created with primary flag $primary.") if T(2);          Trace("Relation $relationName load file created with primary flag $primary.") if T(2);
# Line 147  Line 145 
145      my ($self, @rawFields) = @_;      my ($self, @rawFields) = @_;
146      # Only proceed if we're not ignoring.      # Only proceed if we're not ignoring.
147      if (! $self->{ignore}) {      if (! $self->{ignore}) {
148            # Convert the hash-string fields to their digested value.
149            $self->{dbh}->DigestFields($self->{relName}, \@rawFields);
150          # Insure the field values are okay.          # Insure the field values are okay.
151          my $truncates = $self->{dbh}->VerifyFields($self->{relName}, \@rawFields);          my $truncates = $self->{dbh}->VerifyFields($self->{relName}, \@rawFields);
152          # Run through the list of field values, escaping them.          # Run through the list of field values, escaping them.
# Line 207  Line 207 
207    
208  C<< my $stats = $erload->Finish(); >>  C<< my $stats = $erload->Finish(); >>
209    
210  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.  
211    
212  =over 4  =over 4
213    

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.18

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3