| 1 | |||||||||||||||||||||||||||||||||||
| 2 | package DBIx::SearchBuilder::Handle::SQLite; | ||||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||||
| 4 | 24 | ▶ | use strict; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 5 | 24 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||
| 7 | 24 | ▶ | use base qw(DBIx::SearchBuilder::Handle); | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||
| 9 | =head1 NAME | ||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||
| 11 | DBIx::SearchBuilder::Handle::SQLite -- A SQLite specific Handle object | ||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||
| 13 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||
| 16 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||
| 18 | This module provides a subclass of DBIx::SearchBuilder::Handle that | ||||||||||||||||||||||||||||||||||
| 19 | compensates for some of the idiosyncrasies of SQLite. | ||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||
| 21 | =head1 METHODS | ||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||
| 23 | =head2 DatabaseVersion | ||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||
| 25 | Returns the version of the SQLite library which is used, e.g., "2.8.0". | ||||||||||||||||||||||||||||||||||
| 26 | SQLite can only return short variant. | ||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||
| 28 | =cut | ||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||
| 30 | sub DatabaseVersion { | ||||||||||||||||||||||||||||||||||
| 31 | 24 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||
|
Subroutine
DatabaseVersion: called CC=3 SCAR=11.7
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 32 | 24 | ▶ | return '' unless $self->dbh; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 33 | 24 | ▶ | return $self->dbh->{sqlite_version} || ''; | ||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->dbh->{'sqlite_version'} || ''
MC/DC0%0/1
$self->dbh->{'sqlite_version'} || ''
$self->dbh->{'sqlite_version'}
Truth table50%1/2
A
A= $self->dbh->{'sqlite_version'}
| |||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||
| 36 | =head2 Insert | ||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||
| 38 | Takes a table name as the first argument and assumes that the rest of the arguments | ||||||||||||||||||||||||||||||||||
| 39 | are an array of key-value pairs to be inserted. | ||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||
| 41 | If the insert succeeds, returns the id of the insert, otherwise, returns | ||||||||||||||||||||||||||||||||||
| 42 | a Class::ReturnValue object with the error reported. | ||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||
| 44 | =cut | ||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||
| 46 | sub _last_insert_rowid { | ||||||||||||||||||||||||||||||||||
| 47 | 150 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||
|
Subroutine
_last_insert_rowid: called CC=2 SCAR=10.9
| |||||||||||||||||||||||||||||||||||
| 48 | 150 | my $table = shift; | |||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||
| 50 | 150 | return $self->dbh->func('last_insert_rowid'); | |||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||
| 52 | # XXX: this is workaround nesty sqlite problem that | ||||||||||||||||||||||||||||||||||
| 53 | # last_insert_rowid in transaction is inaccurrate with multiple | ||||||||||||||||||||||||||||||||||
| 54 | # inserts. | ||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||
| 56 | 0 | ▶ | return $self->dbh->func('last_insert_rowid') | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 57 | unless $self->TransactionDepth; | ||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||
| 59 | # XXX: is the name of the column always id ? | ||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||
| 61 | 0 | my $ret = $self->FetchResult("select max(id) from $table"); | |||||||||||||||||||||||||||||||||
| 62 | 0 | return $ret; | |||||||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||
| 65 | sub Insert { | ||||||||||||||||||||||||||||||||||
| 66 | 150 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||
|
Subroutine
Insert: called CC=4 SCAR=14.6
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 67 | 150 | my $table = shift; | |||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||
| 69 | 150 | my %args = ( id => undef, @_); | |||||||||||||||||||||||||||||||||
| 70 | # We really don't want an empty id | ||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||
| 72 | 150 | my $sth = $self->SUPER::Insert($table, %args); | |||||||||||||||||||||||||||||||||
| 73 | 150 | ▶ | return unless $sth; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||
| 75 | # If we have set an id, then we want to use that, otherwise, we want to lookup the last _new_ rowid | ||||||||||||||||||||||||||||||||||
| 76 | 150 | ▶ | $self->{'id'}= $args{'id'} || $self->_last_insert_rowid($table); | ||||||||||||||||||||||||||||||||
|
Condition33%1/3
$args{'id'} || $self->_last_insert_rowid($table)
MC/DC0%0/2
$args{'id'} || $self->_last_insert_rowid($table)
$args{'id'}
$self->_last_insert_rowid($table)
Truth table33%1/3
A || B
A= $args{'id'}B= $self->_last_insert_rowid($table)
| |||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||
| 78 | 150 | ▶ | warn "$self no row id returned on row creation" unless ($self->{'id'}); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 79 | 150 | return( $self->{'id'}); #Add Succeded. return the id | |||||||||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||
| 84 | =head2 CaseSensitive | ||||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||||
| 86 | Returns undef, since SQLite's searches are not case sensitive by default | ||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||
| 88 | =cut | ||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||
| 90 | sub CaseSensitive { | ||||||||||||||||||||||||||||||||||
| 91 | 116 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||
|
Subroutine
CaseSensitive: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 92 | 116 | return(1); | |||||||||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||
| 95 | sub BinarySafeBLOBs { | ||||||||||||||||||||||||||||||||||
| 96 | 0 | ▶ | return undef; | ||||||||||||||||||||||||||||||||
|
Subroutine
BinarySafeBLOBs: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 97 | } | ||||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||||
| 99 | sub DistinctQuery { | ||||||||||||||||||||||||||||||||||
| 100 | 96 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||
|
Subroutine
DistinctQuery: called CC=6 SCAR=18.1
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 101 | 96 | my $statementref = shift; | |||||||||||||||||||||||||||||||||
| 102 | 96 | my $sb = shift; | |||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||
| 104 | 96 | ▶ | return $self->SUPER::DistinctQuery( $statementref, $sb, @_ ) | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 105 | if $sb->_OrderClause !~ /(?<!main)\./; | ||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||
| 107 | 32 | local $sb->{'group_by'} = [{FIELD => 'id'}]; | |||||||||||||||||||||||||||||||||
| 108 | local $sb->{'order_by'} = [ | ||||||||||||||||||||||||||||||||||
| 109 | map { | ||||||||||||||||||||||||||||||||||
| 110 | ($_->{'ALIAS'}||'') ne "main" | ||||||||||||||||||||||||||||||||||
| 111 | 32 | ▶ | ? { %{$_}, FIELD => ((($_->{'ORDER'}||'') =~ /^des/i)?'MAX':'MIN') ."(".$_->{FIELD}.")" } | ||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition50%2/4
$_->{'ALIAS'} || ''
$_->{'ORDER'} || ''
MC/DC0%0/1
$_->{'ALIAS'} || ''
$_->{'ALIAS'}
MC/DC0%0/1
$_->{'ORDER'} || ''
$_->{'ORDER'}
Truth table50%1/2
A
A= $_->{'ALIAS'}
Truth table50%1/2
A
A= $_->{'ORDER'}
| |||||||||||||||||||||||||||||||||||
| 112 | : $_ | ||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||
| 114 | 32 | @{$sb->{'order_by'}} | |||||||||||||||||||||||||||||||||
| 115 | ]; | ||||||||||||||||||||||||||||||||||
| 116 | 32 | $$statementref = "SELECT main.* FROM $$statementref"; | |||||||||||||||||||||||||||||||||
| 117 | 32 | $$statementref .= $sb->_GroupClause; | |||||||||||||||||||||||||||||||||
| 118 | 32 | $$statementref .= $sb->_OrderClause; | |||||||||||||||||||||||||||||||||
| 119 | } | ||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||
| 121 | =head2 DistinctCount STATEMENTREF | ||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||
| 123 | takes an incomplete SQL SELECT statement and massages it to return a DISTINCT result count | ||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||
| 126 | =cut | ||||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||||
| 128 | sub DistinctCount { | ||||||||||||||||||||||||||||||||||
| 129 | 41 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||
|
Subroutine
DistinctCount: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 130 | 41 | my $statementref = shift; | |||||||||||||||||||||||||||||||||
| 131 | 41 | my $sb = shift; | |||||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||||||
| 133 | 41 | $$statementref = "SELECT count(*) FROM (SELECT DISTINCT main.id FROM $$statementref )"; | |||||||||||||||||||||||||||||||||
| 134 | } | ||||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||
| 136 | sub Fields { | ||||||||||||||||||||||||||||||||||
| 137 | 2 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||
|
Subroutine
Fields: called CC=6 SCAR=18.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 138 | 2 | my $table = shift; | |||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||
| 140 | 2 | my $cache = \%DBIx::SearchBuilder::Handle::FIELDS_IN_TABLE; | |||||||||||||||||||||||||||||||||
| 141 | 2 | ▶ | unless ( $cache->{lc $table} ) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 142 | 2 | ▶ | my $info = $self->dbh->selectall_arrayref("PRAGMA table_info('$table')") | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 143 | or return (); | ||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||
| 145 | 2 | foreach my $e ( @$info ) { | |||||||||||||||||||||||||||||||||
| 146 | 5 | ▶ | push @{ $cache->{ lc $table } ||= [] }, lc $e->[1]; | ||||||||||||||||||||||||||||||||
|
Condition100%2/2
$$cache{lc $table} ||= []
MC/DC100%1/1
$$cache{lc $table} ||= []
$$cache{lc $table}
Truth table100%2/2
A
A= $$cache{lc $table}
| |||||||||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||
| 150 | 2 | ▶ | return @{ $cache->{ lc $table } || [] }; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||
| 153 | =head2 SimpleDateTimeFunctions | ||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||
| 155 | Returns hash reference with specific date time functions of this | ||||||||||||||||||||||||||||||||||
| 156 | database for L<DBIx::SearchBuilder::Handle/DateTimeFunction>. | ||||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||||
| 158 | =cut | ||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||
| 160 | sub SimpleDateTimeFunctions { | ||||||||||||||||||||||||||||||||||
| 161 | 20 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||
|
Subroutine
SimpleDateTimeFunctions: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 162 | return $self->{'_simple_date_time_functions'} ||= { | ||||||||||||||||||||||||||||||||||
| 163 | 20 | ▶ | %{ $self->SUPER::SimpleDateTimeFunctions(@_) }, | ||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->{"_simple_date_time_functions"} ||= {%{$self->SUPER::SimpleDateTimeFunctions(@_);}, "datetime", "datetime(?)", "time", "time(?)", "hourly", "strftime('%Y-%m-%d %H', ?)", "hour", "strftime('%H', ?)", "date", "date(?)", "daily", "date(?)", "day", "strftime('%d', ?)", "dayofmonth", "strftime('%d', ?)", "monthly", "strftime('%Y-%m', ?)", "month", "strftime('%m', ?)", "annually", "strftime('%Y', ?)", "year", "strftime('%Y', ?)", "dayofweek", "strftime('%w', ?)", "dayofyear", "strftime('%j', ?)", "weekofyear", "strftime('%W', ?)"}
MC/DC100%1/1
$self->{"_simple_date_time_functions"} ||= {%{$self->SUPER::SimpleDateTimeFunctions(@_);}, "datetime", "datetime(?)", "time", "time(?)", "hourly", "strftime('%Y-%m-%d %H', ?)", "hour", "strftime('%H', ?)", "date", "date(?)", "daily", "date(?)", "day", "strftime('%d', ?)", "dayofmonth", "strftime('%d', ?)", "monthly", "strftime('%Y-%m', ?)", "month", "strftime('%m', ?)", "annually", "strftime('%Y', ?)", "year", "strftime('%Y', ?)", "dayofweek", "strftime('%w', ?)", "dayofyear", "strftime('%j', ?)", "weekofyear", "strftime('%W', ?)"}
$self->{"_simple_date_time_functions"}
Truth table100%2/2
A
A= $self->{"_simple_date_time_functions"}
| |||||||||||||||||||||||||||||||||||
| 164 | datetime => 'datetime(?)', | ||||||||||||||||||||||||||||||||||
| 165 | time => 'time(?)', | ||||||||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||||||||
| 167 | hourly => "strftime('%Y-%m-%d %H', ?)", | ||||||||||||||||||||||||||||||||||
| 168 | hour => "strftime('%H', ?)", | ||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||
| 170 | date => 'date(?)', | ||||||||||||||||||||||||||||||||||
| 171 | daily => 'date(?)', | ||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||
| 173 | day => "strftime('%d', ?)", | ||||||||||||||||||||||||||||||||||
| 174 | dayofmonth => "strftime('%d', ?)", | ||||||||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||||||||
| 176 | monthly => "strftime('%Y-%m', ?)", | ||||||||||||||||||||||||||||||||||
| 177 | month => "strftime('%m', ?)", | ||||||||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||||||||
| 179 | annually => "strftime('%Y', ?)", | ||||||||||||||||||||||||||||||||||
| 180 | year => "strftime('%Y', ?)", | ||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||
| 182 | dayofweek => "strftime('%w', ?)", | ||||||||||||||||||||||||||||||||||
| 183 | dayofyear => "strftime('%j', ?)", | ||||||||||||||||||||||||||||||||||
| 184 | weekofyear => "strftime('%W', ?)", | ||||||||||||||||||||||||||||||||||
| 185 | }; | ||||||||||||||||||||||||||||||||||
| 186 | } | ||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||
| 188 | sub ConvertTimezoneFunction { | ||||||||||||||||||||||||||||||||||
| 189 | 2 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||
|
Subroutine
ConvertTimezoneFunction: called CC=8 SCAR=32.5
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 190 | 2 | my %args = ( | |||||||||||||||||||||||||||||||||
| 191 | From => 'UTC', | ||||||||||||||||||||||||||||||||||
| 192 | To => undef, | ||||||||||||||||||||||||||||||||||
| 193 | Field => '', | ||||||||||||||||||||||||||||||||||
| 194 | @_ | ||||||||||||||||||||||||||||||||||
| 195 | ); | ||||||||||||||||||||||||||||||||||
| 196 | 2 | ▶ | return $args{'Field'} unless $args{From} && $args{'To'}; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$args{"From"} and $args{"To"}
MC/DC50%1/2
$args{"From"} and $args{"To"}
$args{"From"}
$args{"To"}
Truth table66%2/3
A and B
A= $args{"From"}B= $args{"To"}
| |||||||||||||||||||||||||||||||||||
| 197 | 1 | ▶ | return $args{'Field'} if lc $args{From} eq lc $args{'To'}; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||||||||
| 199 | 0 | my $res; | |||||||||||||||||||||||||||||||||
| 200 | 0 | ▶ | if ( lc($args{'To'}||'') eq 'utc' ) { | ||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/2
$args{'To'} || ''
MC/DC0%0/1
$args{'To'} || ''
$args{'To'}
Truth table0%0/2
A
A= $args{'To'}
| |||||||||||||||||||||||||||||||||||
| 201 | 0 | $res = "datetime($args{'Field'}, 'utc')"; | |||||||||||||||||||||||||||||||||
| 202 | } | ||||||||||||||||||||||||||||||||||
| 203 | ▶ | elsif ( lc($args{'From'}||'') eq 'utc' ) { | |||||||||||||||||||||||||||||||||
|
Condition0%0/2
$args{'From'} || ''
MC/DC0%0/1
$args{'From'} || ''
$args{'From'}
Truth table0%0/2
A
A= $args{'From'}
| |||||||||||||||||||||||||||||||||||
| 204 | 0 | $res = "datetime($args{'Field'}, 'localtime')"; | |||||||||||||||||||||||||||||||||
| 205 | } | ||||||||||||||||||||||||||||||||||
| 206 | else { | ||||||||||||||||||||||||||||||||||
| 207 | 0 | warn "SQLite only supports TZ convesion from UTC or to UTC"; | |||||||||||||||||||||||||||||||||
| 208 | 0 | $res = $args{'Field'}; | |||||||||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||||||||
| 210 | 0 | return $res; | |||||||||||||||||||||||||||||||||
| 211 | } | ||||||||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||||||||
| 213 | sub _DateTimeIntervalFunction { | ||||||||||||||||||||||||||||||||||
| 214 | 2 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||
|
Subroutine
_DateTimeIntervalFunction: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 215 | 2 | my %args = ( From => undef, To => undef, @_ ); | |||||||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||||||||
| 217 | 2 | return "strftime('%s',$args{'To'}) - strftime('%s',$args{'From'})"; | |||||||||||||||||||||||||||||||||
| 218 | } | ||||||||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||||||||
| 220 | 24 | 1; | |||||||||||||||||||||||||||||||||