Basic/Util/LogDispatchDBI.pm untested

filter: Statementstmt 0.0% 0 / 13 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 22 CC 3 SCAR 19.5
CC
3
Cov
0%
create_statement
12.0
BEGIN
2.0
BEGIN
2.0
CRAP 7.0
1 package CGI::Application::Demo::Basic::Util::LogDispatchDBI;
2  
3 # Note:
4 # o tab = 4 spaces || die
5 #
6 # Author:
7 # Ron Savage <ron@savage.net.au>
8 # Home page: http://savage.net.au/index.html
9  
10 use base qw/Log::Dispatch::DBI CGI::Application::Demo::Basic::Base/;
11 use strict;
12 use warnings;
13  
14 our $VERSION = '1.06';
15  
16 # --------------------------------------------------
17  
18 sub create_statement
19 {
20 my($self) = @_;
21 my($sql) = $self -> db_vendor eq 'ORACLE'
22 ? "insert into $$self{'table'} (id, lvl, message, timestamp) values (log_seq.nextval, ?, ?, localtimestamp)"
23 : $self -> db_vendor eq 'SQLITE'
24 ? "insert into $$self{'table'} (lvl, message, timestamp) values (?, ?, 'now')"
25 : "insert into $$self{'table'} (lvl, message, timestamp) values (?, ?, now() )"; # MySQL, Postgres.
26  
27 return $$self{'dbh'} -> prepare($sql);
28  
29 } # End of create_statement.
30  
31 # --------------------------------------------------
32  
33 1;