sub _sqlt_minimum_version { $minimum_sqlt_version };
}
+# Pretty printer for debug messages
+sub _pretty_print {
+
+ require Data::Dumper;
+ local $Data::Dumper::Terse = 1;
+ local $Data::Dumper::Indent = 1;
+ local $Data::Dumper::Useqq = 1;
+ local $Data::Dumper::Quotekeys = 0;
+ local $Data::Dumper::Sortkeys = 1;
+
+ return Data::Dumper::Dumper ($_[1]);
+}
+
1;
$self->throw_exception("Unexpected populate error: $err")
if ($i > $#$tuple_status);
- require Data::Dumper;
- local $Data::Dumper::Terse = 1;
- local $Data::Dumper::Indent = 1;
- local $Data::Dumper::Useqq = 1;
- local $Data::Dumper::Quotekeys = 0;
- local $Data::Dumper::Sortkeys = 1;
-
$self->throw_exception(sprintf "%s for populate slice:\n%s",
($tuple_status->[$i][1] || $err),
- Data::Dumper::Dumper(
- { map { $cols->[$_] => $data->[$i][$_] } (0 .. $#$cols) }
- ),
+ $self->_pretty_print ({
+ map { $cols->[$_] => $data->[$i][$_] } (0 .. $#$cols)
+ }),
);
}
$self->throw_exception("Unexpected populate error: $err")
if ($i > $#$tuple_status);
- require Data::Dumper;
- local $Data::Dumper::Terse = 1;
- local $Data::Dumper::Indent = 1;
- local $Data::Dumper::Useqq = 1;
- local $Data::Dumper::Quotekeys = 0;
- local $Data::Dumper::Sortkeys = 1;
-
$self->throw_exception(sprintf "%s for populate slice:\n%s",
($tuple_status->[$i][1] || $err),
- Data::Dumper::Dumper(
- { map { $source_columns[$_] => $new_data[$i][$_] } (0 .. $#$cols) }
- ),
+ $self->_pretty_print ({
+ map { $source_columns[$_] => $new_data[$i][$_] } (0 .. $#$cols)
+ }),
);
}
my $sth = $cursor->sth;
if (not $sth) {
- require Data::Dumper;
- local $Data::Dumper::Terse = 1;
- local $Data::Dumper::Indent = 1;
- local $Data::Dumper::Useqq = 1;
- local $Data::Dumper::Quotekeys = 0;
- local $Data::Dumper::Sortkeys = 1;
-
- croak "\nCould not find row in table '$table' for blob update:\n".
- Data::Dumper::Dumper(\%where)."\n";
+
+ $self->throw_exception(
+ "Could not find row in table '$table' for blob update:\n"
+ . $self->_pretty_print (\%where)
+ );
}
eval {