Pretty/Handler/DBI/db.pm

filter: Statementstmt 62.5% 10 / 16 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 60.8% 14 / 23 CC 2 SCAR 11.0
CC
2
Cov
56%
new
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« Pretty/Print.pm ↑ Summary Pretty/Rule.pm »
1 #!/usr/bin/perl
2 package SQL::QueryBuilder::Pretty::Handler::DBI::db;
3  
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod documented
10 0 my $class = shift;
11 0 my %self = @_;
12  
13 0 my $database = $self{'handler'}->{'Driver'}->{'Name'};
14  
15 0 $class = CORE::join( q{::}, $class, $database );
16 0 ▶ eval "use $class; 1" or croak $@;
Branch: 1 branch
BranchTrueFalseTotal
eval "use $class; 1" or croak($@) 0 0 0
17 0 return $class->new( %self );
18 }
19  
20 =head1 NAME
21  
22 SQL::QueryBuilder::Pretty::Handler::DBI::db - DBI handler extension for
23 SQL::QueryBuilder::Pretty.
24  
25 =head1 VERSION
26  
27 Version 0.01
28  
29 =head1 SYNOPSIS
30  
31 Directly:
32  
33 use SQL::QueryBuilder::Pretty::Handler::DBI::db;
34  
35 my $pretty = SQL::QueryBuilder::Pretty::Handler::DBI::db->new();
36  
37 print $pretty->print('SELECT * FROM table WHERE col1 = NOW()');
38  
39 or indirecly using SQL::QueryBuilder::Pretty:
40  
41 use SQL::QueryBuilder::Pretty;
42  
43 my $pretty = SQL::QueryBuilder::Pretty->new(
44 '-handler' => $dbh,
45 );
46  
47 print $pretty->print('SELECT * FROM table WHERE col1 = NOW()');
48  
49 =head1 DESCRIPTION
50  
51 L<DBI> handler extension for SQL::QueryBuilder::Pretty.
52  
53 =over 4
54  
55 =item I<PACKAGE>->new(I<%options>)
56  
57 Initializes the object.
58  
59 =back
60  
61 =head1 SEE ALSO
62  
63 L<SQL::QueryBuilder::Pretty>, L<DBI>.
64  
65 =head1 AUTHOR
66  
67 André Rivotti Casimiro, C<< <rivotti at cpan.org> >>
68  
69 =head1 COPYRIGHT AND LICENSE
70  
71 Copyright (C) 2009 by André Rivotti Casimiro. Published under the terms of
72 the Artistic License 2.0.
73  
74 =cut
75  
76 1 1;
« Pretty/Print.pm ↑ Summary Pretty/Rule.pm »