10f3c206cc171fbcfb8436be1a9b18e1d65508f0
[dbsrgits/DBIx-Class-RowCountStatistics.git] / lib / DBIx / Class / RowCountStatistics / Storage.pm
1 use strict;
2 use warnings;
3
4 # per-Cursor wrapper object to cache and access SQL later
5 package DBIx::Class::RowCountStatistics::Storage;
6 use Class::Method::Modifiers;
7
8 sub new {
9     my ($class, $original) = @_;
10     return bless {
11         original => $original,
12     }, $class;
13 }
14
15 sub _cached_sql {
16     my ($self) = @_;
17     return $self->{cached_sql};
18 }
19
20 sub throw_exception {
21     my $self = shift;
22     return $self->{original}->throw_exception(@_);
23 }
24
25 sub _select {
26     my $self = shift;
27     my @res = $self->{original}->_select(@_);
28     $self->{cached_sql} = $res[1]{Statement};
29     return @res;
30 }
31
32 sub debug {
33     my $self = shift;
34     return $self->{original}->debug(@_);
35 }
36
37 sub debugobj {
38     my $self = shift;
39     return $self->{original}->debugobj(@_);
40 }
41
42 1;