Alternatively use the C<< storage->debug >> class method:-
- $class->storage->debug(1);
+ $schema->storage->debug(1);
To send the output somewhere else set debugfh:-
- $class->storage->debugfh(IO::File->new('/tmp/trace.out', 'w');
+ $schema->storage->debugfh(IO::File->new('/tmp/trace.out', 'w');
Alternatively you can do this with the environment variable too:-
);
}
+{
+ $schema->storage->debug(1);
+ my $cd_rs = $schema->resultset('CD')->search(undef, {
+ distinct => 1,
+ join => [qw/ tracks /],
+ prefetch => [qw/ artist /],
+ });
+
+ is($cd_rs->all, 5, 'search with has_many join and distinct ok');
+ $schema->storage->debug(0);
+}
+
done_testing;