my $callback = shift;
my @tables = fetch_tables($schema);
+ if (scalar @tables == 0) {
+ return;
+ }
+
+ print "SELECT tables_are(\n";
+ print "\t" . $dbh->quote($schema) . ",\n";
+ print "\tARRAY[\n\t\t";
+ print join(
+ ",\n\t\t",
+ map { $dbh->quote($_) } @tables
+ );
+ print "\n\t],\t" . $dbh->quote("Found expected tables for schema $schema");
+ print "\n);\n";
+
foreach my $table ( @tables ) {
print "\n-- -- table " . $dbh->quote("$schema.$table") . "\n\n";
- print "SELECT has_table(\n";
- print "\t" . $dbh->quote($schema) . ",\n";
- print "\t" . $dbh->quote($table) . ",\n";
- print "\t" . $dbh->quote("Has table $schema.$table") . "\n);\n";
$callback->($schema,$table) if $callback;
}
}