in reply to Re^2: Change DBI database on runtime
in thread Change DBI database on runtime
Wow!, isn't it overkill just for a string with the name of the database?, a name that (yes or yes) must be used in each request?
Well, actually no, normally this name is used only once, when you're instantiating model the first time. It's a rather weird idea to use different databases for different users.
As for how to do this... Look documentation for Catalyst::Model::Adapter, you need to define prepare_arguments and mangle_arguments methods. If you want more control (and you probably do, you can cache models for different users), you can write your own ACCEPT_CONTEXT method (see docs for Catalyst::Component and sources of Catalyst::Model::Factory). All this may be a bit tricky, and documentation is not especially verbose, but I'm sure you will enjoy the process.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Change DBI database on runtime
by miguelele (Beadle) on Nov 15, 2011 at 00:11 UTC | |
by zwon (Abbot) on Nov 15, 2011 at 02:43 UTC | |
by miguelele (Beadle) on Nov 15, 2011 at 20:36 UTC | |
by zwon (Abbot) on Nov 16, 2011 at 12:33 UTC | |
by miguelele (Beadle) on Nov 17, 2011 at 13:43 UTC | |
Re^4: Change DBI database on runtime
by miguelele (Beadle) on Nov 14, 2011 at 16:58 UTC |
In Section
Seekers of Perl Wisdom