Changeset 97

Show
Ignore:
Timestamp:
05/04/06 00:07:50 (4 years ago)
Author:
sky
Message:

r100@crucially-3 (orig r1083): mpaschal | 2006-01-11 11:43:39 -0800
Allow extra DBI->connect options with Driver->new( connect_options => {} )
Add missing ) in synopsis found while looking for a place to document connect_options (which there isn't)

Location:
trunk/lib/Data
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/Data/ObjectDriver.pm

    r92 r97  
    5454            username => 'username', 
    5555            password => 'password', 
     56        ) 
    5657    } 
    5758 
  • trunk/lib/Data/ObjectDriver/Driver/DBI.pm

    r96 r97  
    1010use Data::ObjectDriver::Driver::DBD; 
    1111 
    12 __PACKAGE__->mk_accessors(qw( dsn username password dbh get_dbh dbd )); 
     12__PACKAGE__->mk_accessors(qw( dsn username password connect_options dbh get_dbh dbd )); 
    1313 
    1414sub init { 
     
    4848        local $SIG{ALRM} = sub { die "alarm\n" }; 
    4949        $dbh = DBI->connect($driver->dsn, $driver->username, $driver->password, 
    50             { RaiseError => 1, PrintError => 0, AutoCommit => 1 }) 
     50            { RaiseError => 1, PrintError => 0, AutoCommit => 1, 
     51              %{$driver->connect_options || {}} }) 
    5152            or Carp::croak("Connection error: " . $DBI::errstr); 
    5253        alarm 0;