From 985d84813a195f343abaf7e33f08057efcb5cb10 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 12 Oct 1998 23:40:28 +0000 Subject: added Pg-specific behaviour in sub line --- site_perl/dbdef_column.pm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'site_perl/dbdef_column.pm') diff --git a/site_perl/dbdef_column.pm b/site_perl/dbdef_column.pm index 023b57d1f..06388c691 100644 --- a/site_perl/dbdef_column.pm +++ b/site_perl/dbdef_column.pm @@ -143,7 +143,13 @@ supported in the future. 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.')' : '' ), @@ -159,6 +165,10 @@ sub line { L, L, L +=head1 VERSION + +$Id: dbdef_column.pm,v 1.2 1998-10-12 23:40:28 ivan Exp $ + =head1 HISTORY class for dealing with column definitions @@ -169,6 +179,11 @@ now methods can be used to get or set data ivan@sisd.com 98-may-11 mySQL-specific hack for null (what should be default?) ivan@sisd.com 98-jun-2 +$Log: dbdef_column.pm,v $ +Revision 1.2 1998-10-12 23:40:28 ivan +added Pg-specific behaviour in sub line + + =cut 1; -- cgit v1.2.1 From 3232d3f822612b1c78db57a9fd1494cc6bc7494c Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 13 Oct 1998 13:04:17 +0000 Subject: fixed doc to indicate Pg specific syntax too --- site_perl/dbdef_column.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'site_perl/dbdef_column.pm') diff --git a/site_perl/dbdef_column.pm b/site_perl/dbdef_column.pm index 06388c691..dc07305b8 100644 --- a/site_perl/dbdef_column.pm +++ b/site_perl/dbdef_column.pm @@ -134,9 +134,8 @@ sub length { Returns an SQL column definition. -If passed a DBI $datasrc specifying L, 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 or L, will use +engine-specific syntax. =cut @@ -167,7 +166,7 @@ L, L, L =head1 VERSION -$Id: dbdef_column.pm,v 1.2 1998-10-12 23:40:28 ivan Exp $ +$Id: dbdef_column.pm,v 1.3 1998-10-13 13:04:17 ivan Exp $ =head1 HISTORY @@ -180,7 +179,10 @@ now methods can be used to get or set data ivan@sisd.com 98-may-11 mySQL-specific hack for null (what should be default?) ivan@sisd.com 98-jun-2 $Log: dbdef_column.pm,v $ -Revision 1.2 1998-10-12 23:40:28 ivan +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 -- cgit v1.2.1