1 package DBIx::Class::Storage::Debug::PrettyPrint;
3 use base 'DBIx::Class::Storage::Statistics';
5 use SQL::Abstract::Tree;
7 __PACKAGE__->mk_group_accessors( simple => '_sqlat' );
12 my $sqlat = SQL::Abstract::Tree->new(shift @_);
13 my $self = $class->next::method(@_);
15 $self->_sqlat($sqlat);
24 my $formatted = $self->_sqlat->format($string);
26 $self->next::method($formatted, @_);
35 package MyApp::Schema;
37 use parent 'DBIx::Class::Schema';
39 use DBIx::Class::Storage::Debug::PrettyPrint;
41 __PACKAGE__->load_namespaces;
43 my $pp = DBIx::Class::Storage::Debug::PrettyPrint->new({
50 my $ret = $self->next::method(@_);
52 $self->storage->debugobj($pp);