use Carp::Clan qw/^DBIx::Class/;
use Class::C3;
-our $VERSION = '0.04999_04';
+our $VERSION = '0.04999_06';
=head1 NAME
=cut
+sub _setup {
+ my $self = shift;
+
+ $self->next::method(@_);
+
+ my $dbh = $self->schema->storage->dbh;
+ $self->{db_schema} ||= $dbh->selectrow_array('VALUES(CURRENT_USER)', {});
+}
+
sub _table_uniq_info {
my ($self, $table) = @_;
return \@uniqs;
}
-sub _tables_list {
+# DBD::DB2 doesn't follow the DBI API for ->tables
+sub _tables_list {
my $self = shift;
- return map lc, $self->next::method;
+
+ my $dbh = $self->schema->storage->dbh;
+ my @tables = map { lc } $dbh->tables(
+ $self->db_schema ? { TABLE_SCHEM => $self->db_schema } : undef
+ );
+ s/\Q$self->{_quoter}\E//g for @tables;
+ s/^.*\Q$self->{_namesep}\E// for @tables;
+
+ return @tables;
}
sub _table_pk_info {