use strict;
use base 'DBIx::Class::Schema::Loader::Generic';
-use DBI;
use Carp;
=head1 NAME
}
sub _tables {
- my $self = shift;
- my $dbh = $self->{_storage}->dbh;
+ my $class = shift;
+ my $dbh = $class->storage->dbh;
# This is split out to avoid version parsing errors...
my $is_dbd_pg_gte_131 = ( $DBD::Pg::VERSION >= 1.31 );
my @tables = $is_dbd_pg_gte_131 ?
- $dbh->tables( undef, $self->{_db_schema}, "", "table", { noprefix => 1, pg_noprefix => 1 } )
+ $dbh->tables( undef, $class->loader_data->{_db_schema}, "", "table", { noprefix => 1, pg_noprefix => 1 } )
: $dbh->tables;
s/"//g for @tables;
}
sub _table_info {
- my ( $self, $table ) = @_;
- my $dbh = $self->{_storage}->dbh;
+ my ( $class, $table ) = @_;
+ my $dbh = $class->storage->dbh;
- my $sth = $dbh->column_info(undef, $self->{_db_schema}, $table, undef);
+ my $sth = $dbh->column_info(undef, $class->loader_data->{_db_schema}, $table, undef);
my @cols = map { $_->[3] } @{ $sth->fetchall_arrayref };
s/"//g for @cols;
- my @primary = $dbh->primary_key(undef, $self->{_db_schema}, $table);
+ my @primary = $dbh->primary_key(undef, $class->loader_data->{_db_schema}, $table);
s/"//g for @primary;