note
wallisds
<p>I like to look at database issues but I've never used this module. It looks pretty awesome. So as curious as I was I decided to try it. In order to replicate the issue I made a little sample script. When I tried to use: </p>
<code>$oDB_Comparison->deep_compare(@aTable_Names); </code>
<p>I get several errors that are very familiar to me from some work with DBIx::Class. You need to have tables defined a certain way in DBIx::Class for the deep->compare to work (or so it seems to me). But you can use the basic compare without seeing the errors:</p>
<code>
$oDB_Comparison->compare(@tables);
</code>
<p>Also, unless I have this line in my code:</p>
<code>
$oDB_Comparison->verbose;
</code>
<p>no results print, so you want to add that in I think. You need to check your definition of $dbh1 and $dbh2 like mje said.</p>
<code>
my $dbh1 = DBI->connect('DBI:DATABASE_TYPE:DATABASE_NAME:DATABASE_SERVER','USERNAME','PASSWORD') || die "Error Connecting to \$dbh1: ".$DBI::errstr."\n";
</code>
<p>Also see <a href="http://search.cpan.org/~abraxxa/DBIx-Class-0.08127/lib/DBIx/Class.pm">DBIx::Class</a></p>
<code>
#!/usr/bin/perl
use strict;
use warnings;
use DBI;
use DBIx::Compare;
my $dbh1 = #SEE sample connect line above
my $dbh2 = #SEE sample connect line above
my $oDB_Comparison = db_comparison->new($dbh1, $dbh2);
my @tables = ('Table1', 'Table2);
$oDB_Comparison->verbose;
$oDB_Comparison->compare(@tables);
</code>
892167
892173