File Coverage

blib/lib/URI/mssql.pm
Criterion Covered Total %
statement 13 13 100.0
branch 8 10 80.0
condition n/a
subroutine 4 4 100.0
pod 2 3 66.6
total 27 30 90.0


line stmt bran cond sub pod time code
1             package URI::mssql;
2 2     2   2444 use base 'URI::_odbc';
  2         4  
  2         893  
3             our $VERSION = '0.19';
4              
5 40     40 1 14126 sub default_port { 1433 }
6 40     40 0 15784 sub canonical_engine { 'mssql' }
7              
8             sub dbi_dsn {
9 23     23 1 6734 my $self = shift;
10 23 100       53 my $driver = shift or return $self->SUPER::dbi_dsn;
11 16         30 my $lcd = lc $driver;
12 16 100       29 return $self->SUPER::dbi_dsn if $lcd eq 'odbc';
13              
14 13 50       28 my $class = $lcd eq 'ado' ? 'URI::_ado'
    100          
15             : $lcd eq 'sybase' ? 'URI::sybase'
16             : die "Unknown driver: $driver\n";
17              
18 13 50       490 eval "require $class" or die;
19              
20             # Make a copy blessed into the alternate class to get its DSN.
21 13         50 my $alt = bless \"$self" => $class;
22 13         85 return $alt->dbi_dsn;
23             }
24              
25             1;
26              
27             =head1 Name
28              
29             URI::mssql - Microsoft SQL Server database URI
30              
31             =head1 Description
32              
33             L format for Microsoft SQL Server.
34              
35             =head1 Interface
36              
37             The following differences exist compared to the C interface:
38              
39             =head2 Instance Methods
40              
41             =head3 C
42              
43             my $dsn = $uri->dbi_dsn;
44             $dsn = $uri->dbi_dsn($driver);
45              
46             Extends the implementation of C to support a driver argument. By
47             default, C returns a DSN appropriate for use with L. Pass
48             "sybase" or "ado" to instead get a DSN appropriate to L or
49             L, respectively. Note that DBD::ADO value is experimental and
50             subject to change. L.
51              
52             =cut