Returns an SQL column definition.
-If passed a DBI $datasrc specifying L<DBD::mysql>, will use MySQL-specific
-syntax. Non-standard syntax for other engines (if applicable) may also be
-supported in the future.
+If passed a DBI $datasrc specifying L<DBD::mysql> or L<DBD::Pg>, will use
+engine-specific syntax.
=cut
sub line {
my($self,$datasrc)=@_;
my($null)=$self->null;
- $null ||= "NOT NULL" if $datasrc =~ /mysql/; #yucky mysql hack
+ if ( $datasrc =~ /mysql/ ) { #yucky mysql hack
+ $null ||= "NOT NULL"
+ }
+ if ( $datasrc =~ /Pg/ ) { #yucky Pg hack
+ $null ||= "NOT NULL";
+ $null =~ s/^NULL$//;
+ }
join(' ',
$self->name,
$self->type. ( $self->length ? '('.$self->length.')' : '' ),
L<FS::dbdef_table>, L<FS::dbdef>, L<DBI>
+=head1 VERSION
+
+$Id: dbdef_column.pm,v 1.3 1998-10-13 13:04:17 ivan Exp $
+
=head1 HISTORY
class for dealing with column definitions
mySQL-specific hack for null (what should be default?) ivan@sisd.com 98-jun-2
+$Log: dbdef_column.pm,v $
+Revision 1.3 1998-10-13 13:04:17 ivan
+fixed doc to indicate Pg specific syntax too
+
+Revision 1.2 1998/10/12 23:40:28 ivan
+added Pg-specific behaviour in sub line
+
+
=cut
1;