[Catalyst] fix config right before database connect?

Matt S Trout dbix-class at trout.me.uk
Sun Apr 6 20:20:30 BST 2008


On Mon, Mar 24, 2008 at 01:58:44PM +0300, Alex Povolotsky wrote:
> Hello!
> 
> I'm running several instances of Catalyst app (for every developer and 
> production) on the same box; I'm thinking of automatically patch 
> database name loaded from config file to allow separate copies of 
> databases to coexist transparently.
> 
> What should I override to fix config AFTER file has been read, but 
> BEFORE database is connected?

We tend to put something like

  dbi:Foo:dbname=__user__

in connect_info and use ConfigLoader's substitution system to define a
programmatic replacement for that. See Plugin::ConfigLoader docs for details.

-- 
      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 Catalyst mailing list