[Bast-commits] r4194 - in
branches/DBIx-Class-Schema-Loader/current: .
lib/DBIx/Class/Schema/Loader/DBI
ilmari at dev.catalyst.perl.org
ilmari at dev.catalyst.perl.org
Thu Mar 13 20:22:34 GMT 2008
Author: ilmari
Date: 2008-03-13 20:22:34 +0000 (Thu, 13 Mar 2008)
New Revision: 4194
Modified:
branches/DBIx-Class-Schema-Loader/current/Changes
branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm
Log:
Fix limiting table list to the specified schema for DB2
Modified: branches/DBIx-Class-Schema-Loader/current/Changes
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/Changes 2008-03-13 19:06:48 UTC (rev 4193)
+++ branches/DBIx-Class-Schema-Loader/current/Changes 2008-03-13 20:22:34 UTC (rev 4194)
@@ -1,5 +1,8 @@
Revision history for Perl extension DBIx::Class::Schema::Loader
+Not yet released
+ - Fix limiting table list to the specified schema for DB2
+
0.04999_04 Wed Mar 12, 2008
- Add is_auto_increment detecton for DB2
Modified: branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm 2008-03-13 19:06:48 UTC (rev 4193)
+++ branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm 2008-03-13 20:22:34 UTC (rev 4194)
@@ -59,9 +59,18 @@
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 {
More information about the Bast-commits
mailing list