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

Matt S Trout dbix-class at trout.me.uk
Tue Aug 26 21:57:25 BST 2008


On Tue, Aug 26, 2008 at 04:18:33PM +0300, Oleg Kostyuk wrote:
> 2008/8/26 Peter Rabbitson <rabbit+list at rabbit.us>:
> > ->method([{}]) seems rather weird to me. Why not go the whole 9 yards
> > and change it to take either the old ([...]) or the new ({...}).

I don't think "old" would be applicable here. I chose the original format
specifically because it mirrors the DBI connection info structure, and I
think we should preserve that capability.
 
> Of course, "...->method([{}])" seems slightly weird.
> In reality, you will need to write such code in very-very rare conditions.

I don't really mind ->connect_info taking [{}] since ->connect is normally
called with an array, but I'd rather this feature was added as an
additional parse_connect_info method so that other storage classes can
override it - for example, we can then add 'dbname', 'host', etc.
parameters and let the different Storage::DBI::* classes construct the
DSN themselves.

> >From other side, this patch already created and tested, it's short and
> can be used right now.
> IMHO, of course.
> 
> PS: probably, this patch is needed mainly for Catalyst rather than for
> DBIC itself.
> It's just a sugar for config files. All other (and
> "...->method([{}])") - just a side effect.

Well, if the patch is only designed for Catalyst, why didn't you write it
against Catalyst::Model::DBIC::Schema?

Not that I don't want the feature in DBIC, but I'm just saying :)

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the DBIx-Class mailing list