Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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.


In reply to Re^3: Change DBI database on runtime by zwon
in thread Change DBI database on runtime by miguelele

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-25 07:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found