DSNParser

DSNParser parses DSNs and creates connections to MySQL using DBI and DBD::mysql.

Summary
DSNParserDSNParser parses DSNs and creates connections to MySQL using DBI and DBD::mysql.
Variables
$have_dbi
Functions
new
prop
parseParse a DSN string like “h=host,P=3306”.
parse_options
as_string
usage
get_cxn_params
fill_in_dsn

Variables

$have_dbi

my $have_dbi

Functions

new

sub new

Parameters

%argsArguments

Required Arguments

optsHashref of DSN options, usually created in OptionParser::get_specs()

Returns

DSNParser object

prop

sub prop

parse

sub parse

Parse a DSN string like “h=host,P=3306”.

Parameters

$dsnDSN string
$prevOptional DSN hashref with previous DSN values
$defaultsOptional DSN hashref with default DSN values, used if a prop isn’t specified in $dsn or $prev

Returns

A DSN hashref like:

{
  D => 'database',
  F => undef,
  h => 'host',
  p => 'mysql-password',
  P => 3306,
  S => undef,
  t => 'table',
  u => 'mysql-user',
  A => undef,
}

parse_options

sub parse_options

as_string

sub as_string

usage

sub usage

get_cxn_params

sub get_cxn_params

fill_in_dsn

sub fill_in_dsn
my $have_dbi
sub new
sub prop
sub parse
Parse a DSN string like “h=host,P=3306”.
sub parse_options
sub as_string
sub usage
sub get_cxn_params
sub fill_in_dsn
sub get_specs
Read and parse options from the OPTIONS section of the POD.
Close