ask for "public" db schema only from Pg DBIx_DBSchema_0_26
authorivan <ivan>
Thu, 7 Apr 2005 08:14:52 +0000 (08:14 +0000)
committerivan <ivan>
Thu, 7 Apr 2005 08:14:52 +0000 (08:14 +0000)
Changes
DBSchema.pm
DBSchema/DBD.pm
DBSchema/DBD/Pg.pm

diff --git a/Changes b/Changes
index e07b97b..4160b52 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 Revision history for Perl extension DBIx::DBSchema.
 
+0.26 Thu Apr  7 01:09:53 PDT 2005
+       - ask for "public" db schema only from Pg
+
 0.25 Wed Apr  6 16:12:38 PDT 2005
        - depend on DBD::Pg 1.32 or 1.41+ (1.40 was bunk)
 
index 0e7b543..590cb9c 100644 (file)
@@ -14,7 +14,7 @@ use DBIx::DBSchema::ColGroup::Index;
 #@ISA = qw(Exporter);
 @ISA = ();
 
-$VERSION = "0.25";
+$VERSION = "0.26";
 
 =head1 NAME
 
@@ -324,7 +324,13 @@ sub _load_driver {
 
 sub _tables_from_dbh {
   my($dbh) = @_;
-  my $sth = $dbh->table_info or die $dbh->errstr;
+  my $driver = _load_driver($dbh);
+  my $db_catalog =
+    scalar(eval "DBIx::DBSchema::DBD::$driver->default_db_catalog");
+  my $db_schema  =
+    scalar(eval "DBIx::DBSchema::DBD::$driver->default_db_schema");
+  my $sth = $dbh->table_info($db_catalog, $db_schema, '', 'TABLE')
+    or die $dbh->errstr;
   #map { $_->{TABLE_NAME} } grep { $_->{TABLE_TYPE} eq 'TABLE' }
   #  @{ $sth->fetchall_arrayref({ TABLE_NAME=>1, TABLE_TYPE=>1}) };
   map { $_->[0] } grep { $_->[1] =~ /^TABLE$/i }
index a4c6000..019b3b1 100644 (file)
@@ -3,7 +3,7 @@ package DBIx::DBSchema::DBD;
 use strict;
 use vars qw($VERSION);
 
-$VERSION = '0.02';
+$VERSION = '0.03';
 
 =head1 NAME
 
@@ -67,6 +67,24 @@ The keys of the hashref are index names, and the values are arrayrefs which
 point a list of column names for each.  See L<perldsc/"HASHES OF LISTS"> and
 L<DBIx::DBSchema::ColGroup>.
 
+=item default_db_catalog
+
+Returns the default database catalog for the DBI table_info command.
+Inheriting from DBIx::DBSchema::DBD will provide the default empty string.
+
+=cut
+
+sub default_db_catalog { ''; }
+
+=item default_db_catalog
+
+Returns the default database schema for the DBI table_info command.
+Inheriting from DBIx::DBSchema::DBD will provide the default empty string.
+
+=cut
+
+sub default_db_schema { ''; }
+
 =back
 
 =head1 TYPE MAPPING
@@ -93,8 +111,7 @@ Ivan Kohler <ivan-dbix-dbschema@420.am>
 
 =head1 COPYRIGHT
 
-Copyright (c) 2000 Ivan Kohler
-Copyright (c) 2000 Mail Abuse Prevention System LLC
+Copyright (c) 2000-2005 Ivan Kohler
 All rights reserved.
 This program is free software; you can redistribute it and/or modify it under
 the same terms as Perl itself.
index 9e91e5e..3218a26 100644 (file)
@@ -8,7 +8,7 @@ die "DBD::Pg version 1.32 or 1.41 (or later) required--".
   if $DBD::Pg::VERSION != 1.32 && $DBD::Pg::VERSION < 1.41;
 use DBIx::DBSchema::DBD;
 
-$VERSION = '0.09';
+$VERSION = '0.10';
 @ISA = qw(DBIx::DBSchema::DBD);
 
 %typemap = (
@@ -34,6 +34,8 @@ This module implements a PostgreSQL-native driver for DBIx::DBSchema.
 
 =cut
 
+sub default_db_schema  { 'public'; }
+
 sub columns {
   my($proto, $dbh, $table) = @_;
   my $sth = $dbh->prepare(<<END) or die $dbh->errstr;