use Carp::Clan qw/^DBIx::Class/;
use UNIVERSAL::require;
-our $VERSION = '0.04003';
+our $VERSION = '0.04999_06';
=head1 NAME
croak "Failed to require $subclass: $@";
}
elsif(!$@) {
- bless $self, "DBIx::Class::Schema::Loader::DBI::${driver}";
+ bless $self, $subclass unless $self->isa($subclass);
}
# Set up the default quoting character and name seperators
my ($self, $table) = @_;
my $dbh = $self->schema->storage->dbh;
- my $sth = $dbh->foreign_key_info( '', '', '', '',
- $self->db_schema, $table );
+ my $sth = $dbh->foreign_key_info( '', $self->db_schema, '',
+ '', $self->db_schema, $table );
return [] if !$sth;
my %rels;
my %result;
eval {
my $sth = $dbh->column_info( undef, $self->db_schema, $table, '%' );
- $sth->execute();
while ( my $info = $sth->fetchrow_hashref() ){
my %column_info;
$column_info{data_type} = $info->{TYPE_NAME};
my $col_name = $info->{COLUMN_NAME};
$col_name =~ s/^\"(.*)\"$/$1/;
- $result{$col_name} = \%column_info;
+ my $extra_info = $self->_extra_column_info($info) || {};
+
+ $result{$col_name} = { %column_info, %$extra_info };
}
$sth->finish;
};
$column_info{size} = $2;
}
- $result{$columns[$i]} = \%column_info;
+ my $extra_info = $self->_extra_column_info($table, $columns[$i], $sth, $i) || {};
+
+ $result{$columns[$i]} = { %column_info, %$extra_info };
}
$sth->finish;
return \%result;
}
+# Override this in vendor class to return any additional column
+# attributes
+sub _extra_column_info {}
+
=head1 SEE ALSO
L<DBIx::Class::Schema::Loader>