Subject: | Can't get a list of tables from an SQLite3 database |
Date: | Sun, 25 May 2014 16:36:35 +0100 |
To: | bug-DBIx-DBSchema [...] rt.cpan.org |
From: | Simon Wistow <simon [...] thegestalt.org> |
It seems like _tables_from_dbh is effectively doing this
my $sth = $dbh->table_info('', '', '', 'TABLE')
or die $dbh->errstr;
$sth->fetchall_arrayref([2,3])
Because $db_catalog and $db_schema are the defaults and are therefore
blank.
Unfortunately that doesn't seem to work on the version of SQLite I'm
running.
However if we change it to
my $sth = $dbh->table_info('', '%', '%', 'TABLE')
or die $dbh->errstr;
$sth->fetchall_arrayref([2,3])
i.e set $db_schema to '%' and set the 3rd 'table' column to '%' as well
... then it all works.
From reading the docs it looks like that's a sensible default for
'table' and testing (albeit only with SQLite and mysql[*]) shows that it
still works that way but perhaps having a new driver settable value
would be better.
Thanks,
Simon
[*] mysql still requires
my $sth = $dbh->table_info('', '', '%', 'TABLE')
or die $dbh->errstr;
$sth->fetchall_arrayref([2,3])
So the default for $db_schema still needs to stay ''