File: DebugObj.pm

package info (click to toggle)
libdbix-class-perl 0.08196-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,424 kB
  • sloc: perl: 22,328; sql: 362; makefile: 10
file content (50 lines) | stat: -rw-r--r-- 866 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package DBIC::DebugObj;

use strict;
use warnings;

use Class::C3;

use base qw/DBIx::Class::Storage::Statistics Exporter Class::Accessor::Fast/;

__PACKAGE__->mk_accessors( qw/dbictest_sql_ref dbictest_bind_ref/ );


=head2 new(PKG, SQL_REF, BIND_REF, ...)

Creates a new instance that on subsequent queries will store
the generated SQL to the scalar pointed to by SQL_REF and bind
values to the array pointed to by BIND_REF.

=cut

sub new {
  my $pkg = shift;
  my $sql_ref = shift;
  my $bind_ref = shift;

  my $self = $pkg->SUPER::new(@_);

  $self->debugfh(undef);

  $self->dbictest_sql_ref($sql_ref);
  $self->dbictest_bind_ref($bind_ref || []);

  return $self;
}

sub query_start {
  my $self = shift;

  (${$self->dbictest_sql_ref}, @{$self->dbictest_bind_ref}) = @_;
}

sub query_end { }

sub txn_begin { }

sub txn_commit { }

sub txn_rollback { }

1;