whops
[dbsrgits/DBIx-Class-Historic.git] / t / lib / DBIC / DebugObj.pm
CommitLineData
b596c25c 1package DBIC::DebugObj;
9b459129 2
3use strict;
4use warnings;
5
6use Exporter;
7use Class::C3;
8
9use base qw/DBIx::Class::Storage::Statistics/;
10use base qw/Exporter/;
11use base qw/Class::Accessor::Fast/;
12
13__PACKAGE__->mk_accessors( qw/dbictest_sql_ref dbictest_bind_ref/ );
14
15
16=head2 new(PKG, SQL_REF, BIND_REF, ...)
17
18Creates a new instance that on subsequent queries will store
19the generated SQL to the scalar pointed to by SQL_REF and bind
20values to the array pointed to by BIND_REF.
21
22=cut
23
24sub new {
25 my $pkg = shift;
26 my $sql_ref = shift;
27 my $bind_ref = shift;
28
29 my $self = $pkg->SUPER::new(@_);
30
31 $self->debugfh(undef);
32
33 $self->dbictest_sql_ref($sql_ref);
34 $self->dbictest_bind_ref($bind_ref);
35
36 return $self;
37}
38
39sub query_start {
40 my $self = shift;
41
42 (${$self->dbictest_sql_ref}, @{$self->dbictest_bind_ref}) = @_;
43}
44
45sub query_end { }
46
47sub txn_start { }
48
49sub txn_commit { }
50
51sub txn_rollback { }
52
531;