sub load {
my $self = shift;
- $self->_load_tables(
- $self->_tables_list({ constraint => $self->constraint, exclude => $self->exclude })
- );
+ $self->_load_tables($self->_tables_list);
}
=head2 rescan
$self->_relbuilder->{schema} = $schema;
my @created;
- my @current = $self->_tables_list({ constraint => $self->constraint, exclude => $self->exclude });
+ my @current = $self->_tables_list;
foreach my $table (@current) {
if(!exists $self->_tables->{$table->sql_name}) {
# Returns an array of table objects
sub _tables_list {
- my ($self, $opts) = (shift, shift);
+ my ($self) = @_;
my @tables;
my $nns = qr/[^\Q$self->{name_sep}\E]/;
foreach my $schema (@{ $self->db_schema || [undef] }) {
- my @raw_table_names = $self->_dbh_tables($schema, @_);
+ my @raw_table_names = $self->_dbh_tables($schema);
TABLE: foreach my $raw_table_name (@raw_table_names) {
my $quoted = $raw_table_name =~ /^$qt/;
}
}
- return $self->_filter_tables(\@tables, $opts);
+ return $self->_filter_tables(\@tables);
}
sub _recurse_constraint {
# apply constraint/exclude and ignore bad tables and views
sub _filter_tables {
- my ($self, $tables, $opts) = @_;
+ my ($self, $tables) = @_;
my @tables = @$tables;
my @filtered_tables;
- $opts ||= {};
- @tables = _check_constraint(1, $opts->{constraint}, @tables);
- @tables = _check_constraint(0, $opts->{exclude}, @tables);
+ @tables = _check_constraint(1, $self->constraint, @tables);
+ @tables = _check_constraint(0, $self->exclude, @tables);
TABLE: for my $table (@tables) {
try {
}
sub _tables_list {
- my ($self, $opts) = @_;
+ my ($self) = @_;
my $sth = $self->dbh->prepare("SELECT * FROM sqlite_master");
$sth->execute;
);
}
$sth->finish;
- return $self->_filter_tables(\@tables, $opts);
+ return $self->_filter_tables(\@tables);
}
sub _table_info_matches {