[Catalyst] multi database at runrime?

Sebastian Riedel sri at oook.de
Thu Apr 28 16:29:18 CEST 2005


Am 28.04.2005 um 05:53 schrieb chunzi:
> Recently I am working on a mail system, and I wanner cache the mails' 
> meta
> informations into a database. I wanner every mail account has it's own 
> database
> for that purpose in his own home dir.
>
> so, after auth the user, I wanner Catalyst start init a CDBI model to 
> connect that
> user based dsn, and later using the same database scheme with same 
> cdbi table classes.
>
> But now, Catalyst only gives a model that connect a single database at 
> startup time.

Well, you can have as much models as you like, but automatic 
instantiation will only work at startup time, right.

It shouldn't be that complicated to add a code generator to a 
controller which creates databases and new model classes on the fly.

Components just need to inherit from Catalyst::Base and a instance 
should be stored in $c->components.

--
sebastian




More information about the Catalyst mailing list