fix table fetching for Sybase and SQLite drivers, patch from Nathan Anderson <http...
[DBIx-DBSchema.git] / DBSchema / DBD / SQLite.pm
index 6cfb017..c810421 100644 (file)
@@ -4,7 +4,7 @@ use base qw( DBIx::DBSchema::DBD );
 use strict;
 use vars qw($VERSION %typemap);
 
-$VERSION = '0.03';
+$VERSION = '0.04';
 
 %typemap = (
   'SERIAL' => 'INTEGER PRIMARY KEY AUTOINCREMENT',
@@ -26,10 +26,12 @@ $schema = new_native DBIx::DBSchema $dbh;
 
 This module implements a SQLite-native driver for DBIx::DBSchema.
 
-=head1 AUTHOR
+=head1 AUTHORS
 
 Jesse Vincent <jesse@bestpractical.com>
 
+Nathan Anderson <http://1id.com/=nathan.anderson>
+
 =cut 
 
 =head1 API 
@@ -186,6 +188,19 @@ while ( my $row = $sth->fetchrow_hashref ) {
 
 }
 
+sub default_db_schema  { '%'; }
+
+sub tables {
+  my($proto, $dbh) = @_;
+  my $db_catalog = $proto->default_db_catalog;
+  my $db_schema  = $proto->default_db_schema;
+
+  my $sth = $dbh->table_info($db_catalog, $db_schema, '%', 'TABLE')
+    or die $dbh->errstr;
+
+  $proto->SUPER::tables($dbh, $sth);
+}
+
 =pod
 
 =back