Revision history for Perl extension DBIx::DBSchema.
+0.20 Mon Mar 4 04:58:34 2002
+ - documentation updates
+ - fix Column->new when using named params
+ - fix Pg driver reverse-engineering length of numeric columns:
+ translate 655362 to 10,2, etc.
+ - fix Pg driver reverse-engineering of text columns (don't have a
+ length)
+
0.19 Tue Oct 23 08:49:12 2001
- documentation for %typemap
- preliminary Sybase driver from Charles Shapiro
#@ISA = qw(Exporter);
@ISA = ();
-$VERSION = "0.19";
+$VERSION = "0.20";
=head1 NAME
use vars qw($VERSION @ISA %typemap);
use DBIx::DBSchema::DBD;
-$VERSION = '0.03';
+$VERSION = '0.04';
@ISA = qw(DBIx::DBSchema::DBD);
%typemap = (
END
$sth->execute or die $sth->errstr;
map {
+
+ my $len = '';
+ if ( $_->{attlen} == -1 && $_->{typname} ne 'text' ) {
+ $len = $_->{atttypmod} - 4;
+ if ( $_->{typname} eq 'numeric' ) {
+ $len = ($len >> 16). ','. ($len & 0xffff);
+ }
+ }
+
+ my $type = $_->{'typname'};
+ $type = 'char' if $type eq 'bpchar';
+
[
$_->{'attname'},
- $_->{'typname'},
+ $type,
! $_->{'attnotnull'},
- ( $_->{'attlen'} == -1
- ? $_->{'atttypmod'} - 4
- : ''
- ),
+ $len,
'', #default
'' #local
- ]
+ ];
+
} @{ $sth->fetchall_arrayref({}) };
}
#new style (preferred), pass a hashref of parameters
$table = new DBIx::DBSchema::Table (
{
- table => "table_name",
+ name => "table_name",
primary_key => "primary_key",
unique => $dbix_dbschema_colgroup_unique_object,
'index' => $dbix_dbschema_colgroup_index_object,
if ( ref($_[0]) ) {
$self = shift;
- $self->{column_order} = [ map { $_->_name } @{$self->{columns}} ];
+ $self->{column_order} = [ map { $_->name } @{$self->{columns}} ];
$self->{columns} = { map { $_->name, $_ } @{$self->{columns}} };
} else {
Currently supported databases are MySQL and PostgreSQL. Sybase support is
partially implemented. DBIx::DBSchema will attempt to use generic SQL syntax
for other databases. Assistance adding support for other databases is
-welcomed. See the DBIx::DBSchema::DBD> manpage, "Driver Writer's Guide and
+welcomed. See the DBIx::DBSchema::DBD manpage, "Driver Writer's Guide and
Base Class".
To install:
Homepage: <http://www.420.am/dbix-dbschema>
-$Id: README,v 1.6 2001-09-05 16:20:03 ivan Exp $
+$Id: README,v 1.7 2002-03-04 12:59:13 ivan Exp $