[Dbix-class] Feature proposal for DBIx::Class::Storage::DBI::connect_info

Peter Rabbitson rabbit+list at rabbit.us
Tue Aug 26 12:11:10 BST 2008


Oleg Kostyuk wrote:
> Hello all.
> 
> Pass one hashref to connect_info is more clean and self-documented, so
> I created patch to allow this.
> With this patch, for example, we can say in Catalyst-based application
> config something like this:
> 
> <Model::DB>
>   schema_class   App::DB
>   <connect_info>
>     dsn          dbi:mysql:database=test
>     user         testuser
>     password     TestPass
>     AutoCommit   1
>   </connect_info>
> </Model::DB>
> 
> or in code:
> 
>   ...->connect_info(
>     [{
>       dsn         => 'dbi:Pg:dbname=foo',
>       user        => 'postgres',
>       password    => 'my_pg_password',
>       AutoCommit  => 1,
>       quote_char  => q{"},
>       name_sep    => q{.},
>     }]
>   );
> 
> Patch attached, and also accessible via RT#38720
> 

->method([{}]) seems rather weird to me. Why not go the whole 9 yards
and change it to take either the old ([...]) or the new ({...}).

My 2c



More information about the DBIx-Class mailing list