[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.2, Tue Jun 30 19:53:01 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

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3