| 1 | package URI::mssql; | ||||||||||||||
| 2 | 2 | ▶ | use base 'URI::_odbc'; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 3 | 2 | our $VERSION = '0.23'; | |||||||||||||
| 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 | 25 | ▶ | my $self = shift; | ||||||||||||
|
Subroutine
dbi_dsn: called CC=6 SCAR=18.0
Pod
documented
| |||||||||||||||
| 10 | 25 | ▶ | my $driver = shift or return $self->SUPER::dbi_dsn; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 11 | 18 | my $lcd = lc $driver; | |||||||||||||
| 12 | 18 | ▶ | return $self->SUPER::dbi_dsn if $lcd eq 'odbc'; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 13 | |||||||||||||||
| 14 | 15 | ▶ | my $class = $lcd eq 'ado' ? 'URI::_ado' | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 15 | : $lcd eq 'sybase' ? 'URI::sybase' | ||||||||||||||
| 16 | : die "Unknown driver: $driver\n"; | ||||||||||||||
| 17 | |||||||||||||||
| 18 | 15 | ▶ | eval "require $class" or die; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 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 | ||||||||||||||