blib/lib/URI/mssql.pm

filter: Statementstmt 100% 15 / 15 Branchbran 80.0% 8 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 66.6% 2 / 3 totaltotal 90.6% 29 / 32 CC 6 SCAR 14.7
CC
6
Cov
92%
dbi_dsn
6.0
BEGIN
1.0
default_port
1.0
CRAP 4.4
↑ Summary Build »
1 package URI::mssql;
2 2 ▶use base 'URI::_odbc';
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 our $VERSION = '0.21';
4  
5 40 ▶sub default_port { 1433 }
Subroutine default_port: called CC=1 SCAR=0.0
Pod documented
6 40 ▶sub canonical_engine { 'mssql' }
Subroutine canonical_engine: called CC=1 SCAR=0.0
Pod undocumented
7  
8 sub dbi_dsn {
9 26 ▶ my $self = shift;
Subroutine dbi_dsn: called CC=6 SCAR=18.0
Pod documented
10 26 ▶ my $driver = shift or return $self->SUPER::dbi_dsn;
Branch: 1 branch
BranchTrueFalseTotal
my $driver = shift() or return $self->SUPER::dbi_dsn 7 19 26
11 19 my $lcd = lc $driver;
12 19 ▶ return $self->SUPER::dbi_dsn if $lcd eq 'odbc';
Branch: 1 branch
BranchTrueFalseTotal
if $lcd eq "odbc" 4 15 19
13  
14 15 ▶ my $class = $lcd eq 'ado' ? 'URI::_ado'
Branch: 2 branches
BranchTrueFalseTotal
$lcd eq 'ado' ? : 7 8 15
$lcd eq 'sybase' ? : 8 0 8
15 : $lcd eq 'sybase' ? 'URI::sybase'
16 : die "Unknown driver: $driver\n";
17  
18 15 ▶ eval "require $class" or die;
Branch: 1 branch
BranchTrueFalseTotal
eval "require $class" or die 0 15 15
19  
20 # Make a copy blessed into the alternate class to get its DSN.
21 15 my $alt = bless \"$self" => $class;
22 15 return $alt->dbi_dsn;
23 }
24  
25 2 1;
26  
27 =head1 Name
28  
29 URI::mssql - Microsoft SQL Server database URI
30  
31 =head1 Description
32  
33 L<URI::db> format for Microsoft SQL Server.
34  
35 =head1 Interface
36  
37 The following differences exist compared to the C<URI::db> interface:
38  
39 =head2 Instance Methods
40  
41 =head3 C<dbi_dsn>
42  
43 my $dsn = $uri->dbi_dsn;
44 $dsn = $uri->dbi_dsn($driver);
45  
46 Extends the implementation of C<dbi_dsn> to support a driver argument. By
47 default, C<dbi_dsn> returns a DSN appropriate for use with L<DBD::ODBC>. Pass
48 "sybase" or "ado" to instead get a DSN appropriate to L<DBD::Sybase> or
49 L<DBD::ADO>, respectively. Note that DBD::ADO value is experimental and
50 subject to change. L<Feedback wanted|https://github.com/theory/uri-db/issues/11>.
51  
52 =cut
↑ Summary Build »