| 1 | package DBIx::SearchBuilder::Handle::ODBC; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use base qw(DBIx::SearchBuilder::Handle); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | =head1 NAME | ||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | DBIx::SearchBuilder::Handle::ODBC - An ODBC specific Handle object | ||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | This module provides a subclass of DBIx::SearchBuilder::Handle that | ||||||||||||||||||||||||||||
| 18 | compensates for some of the idiosyncrasies of ODBC. | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | =head1 METHODS | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | =cut | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | =head2 CaseSensitive | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | Returns a false value. | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | =cut | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 0 | ▶ | sub CaseSensitive { | ||||||||||||||||||||||||||
|
Subroutine
CaseSensitive: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 31 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 32 | 0 | return (undef); | |||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | =head2 BuildDSN | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | =cut | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 0 | ▶ | sub BuildDSN { | ||||||||||||||||||||||||||
|
Subroutine
BuildDSN: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||
| 40 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 41 | 0 | my %args = ( | |||||||||||||||||||||||||||
| 42 | Driver => undef, | ||||||||||||||||||||||||||||
| 43 | Database => undef, | ||||||||||||||||||||||||||||
| 44 | Host => undef, | ||||||||||||||||||||||||||||
| 45 | Port => undef, | ||||||||||||||||||||||||||||
| 46 | @_ | ||||||||||||||||||||||||||||
| 47 | ); | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | 0 | my $dsn = "dbi:$args{'Driver'}:$args{'Database'}"; | |||||||||||||||||||||||||||
| 50 | 0 | ▶ | $dsn .= ";host=$args{'Host'}" if (defined $args{'Host'} && $args{'Host'}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $args{"Host"} and $args{"Host"}
MC/DC0%0/2
defined $args{"Host"} and $args{"Host"}
defined $args{"Host"}
$args{"Host"}
Truth table0%0/3
A and B
A= defined $args{"Host"}B= $args{"Host"}
| |||||||||||||||||||||||||||||
| 51 | 0 | ▶ | $dsn .= ";port=$args{'Port'}" if (defined $args{'Port'} && $args{'Port'}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $args{"Port"} and $args{"Port"}
MC/DC0%0/2
defined $args{"Port"} and $args{"Port"}
defined $args{"Port"}
$args{"Port"}
Truth table0%0/3
A and B
A= defined $args{"Port"}B= $args{"Port"}
| |||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | 0 | $self->{'dsn'} = $dsn; | |||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | =head2 ApplyLimits | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | =cut | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | 0 | ▶ | sub ApplyLimits { | ||||||||||||||||||||||||||
|
Subroutine
ApplyLimits: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 61 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 62 | 0 | my $statementref = shift; | |||||||||||||||||||||||||||
| 63 | 0 | ▶ | my $per_page = shift or return; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 64 | 0 | my $first = shift; | |||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | 0 | my $limit_clause = " TOP $per_page"; | |||||||||||||||||||||||||||
| 67 | 0 | ▶ | $limit_clause .= " OFFSET $first" if $first; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 68 | 0 | $$statementref =~ s/SELECT\b/SELECT $limit_clause/; | |||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | =head2 DistinctQuery | ||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | =cut | ||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | 0 | ▶ | sub DistinctQuery { | ||||||||||||||||||||||||||
|
Subroutine
DistinctQuery: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 76 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 77 | 0 | my $statementref = shift; | |||||||||||||||||||||||||||
| 78 | 0 | my $sb = shift; | |||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | 0 | $$statementref = "SELECT main.* FROM $$statementref"; | |||||||||||||||||||||||||||
| 81 | 0 | $$statementref .= $sb->_GroupClause; | |||||||||||||||||||||||||||
| 82 | 0 | $$statementref .= $sb->_OrderClause; | |||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||
| 85 | 0 | ▶ | sub Encoding { | ||||||||||||||||||||||||||
|
Subroutine
Encoding: not called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | 1 | 1; | |||||||||||||||||||||||||||