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

Diff of /Sprout/ERDBTypeBoolean.pm

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

revision 1.1, Mon Jan 19 21:46:21 2009 UTC revision 1.3, Sat Oct 1 10:35:02 2011 UTC
# Line 180  Line 180 
180    
181  =head3 sqlType  =head3 sqlType
182    
183      my $typeString = $et->sqlType();      my $typeString = $et->sqlType($dbh);
184    
185  Return the SQL data type for this field type.  Return the SQL data type for this field type.
186    
187    =over 4
188    
189    =item dbh
190    
191    Open L<DBKernel> handle for the database in question. This is used when the
192    datatype may be different depending on the DBMS used.
193    
194    =item RETURN
195    
196    Returns the datatype string to be used when creating a field of this type in
197    an SQL table.
198    
199    =back
200    
201  =cut  =cut
202    
203  sub sqlType {  sub sqlType {
204      return "TINYINT";      my ($self, $dbh) = @_;
205        my $retVal = 'INT';
206        if ($dbh->dbms eq 'mysql') {
207            $retVal = "TINYINT";
208        } elsif ($dbh->dbms eq 'Pg') {
209            $retVal = "SMALLINT";
210        }
211        return $retVal;
212  }  }
213    
214  =head3 indexMod  =head3 indexMod
# Line 248  Line 269 
269      my $defaultValue = $et->default();      my $defaultValue = $et->default();
270    
271  Return the default value to be used for fields of this type if no default value  Return the default value to be used for fields of this type if no default value
272  is specified in the database definition or in an [[ERDBLoadGroup#Put]] call  is specified in the database definition or in an L<ERDBLoadGroup/Put> call
273  during a loader operation. The default is undefined, which means an error will  during a loader operation. The default is undefined, which means an error will
274  be thrown during the load.  be thrown during the load.
275    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3