Commit | Line | Data |
497e9bed |
1 | package Chunkstrumenter; |
2 | |
3 | use strictures 2; |
4 | use Class::Method::Modifiers qw(install_modifier); |
5 | use Data::Dumper::Concise; |
6 | use Context::Preserve; |
7 | |
8 | require SQL::Abstract; |
9 | |
10 | open my $log_fh, '>>', 'chunkstrumenter.log'; |
11 | |
12 | install_modifier 'SQL::Abstract', around => '_order_by_chunks' => sub { |
13 | my ($orig, $self) = (shift, shift); |
14 | my @args = @_; |
15 | preserve_context { $self->$orig(@args) } |
16 | after => sub { |
17 | my $dumped = Dumper([ $self->{quote_char}, \@args, \@_ ]); |
18 | $dumped =~ s/\n\Z/,\n/; |
19 | print $log_fh $dumped; |
20 | }; |
21 | }; |
22 | |
23 | 1; |