use Carp::Clan qw/^DBIx::Class/;
use UNIVERSAL::require;
-our $VERSION = '0.03999_01';
+our $VERSION = '0.04999_02';
=head1 NAME
my $sth = $dbh->prepare($self->schema->storage->sql_maker->select($table, undef, \'1 = 0'));
$sth->execute;
- return \@{$sth->{NAME_lc}};
+ my $retval = \@{$sth->{NAME_lc}};
+ $sth->finish;
+
+ $retval;
}
# Returns arrayref of pk col names
$indices{$row->{INDEX_NAME}}->{$row->{ORDINAL_POSITION}} = $row->{COLUMN_NAME};
}
+ $sth->finish;
my @retval;
foreach my $index_name (keys %indices) {
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;
$rels{$relid}->{tbl} = $uk_tbl;
$rels{$relid}->{cols}->{$uk_col} = $fk_col;
}
+ $sth->finish;
my @rels;
foreach my $relid (keys %rels) {
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;
};
return \%result if !$@ && scalar keys %result;
}
$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>