Closed GoogleCodeExporter closed 9 years ago
Dynamic Database Connections / db_Main
It is sometimes desirable to generate your database connection information
dynamically, for example, to allow multiple databases with the same schema to
not have to duplicate an entire class hierarchy.
The preferred method for doing this is to supply your own db_Main() method
rather than calling "connection". This method should return a valid database
handle, and should ensure it sets the standard attributes described above,
preferably by combining $class->_default_attributes() with your own. Note, this
handle *must* have its RootClass set to DBIx::ContextualFetch, so it is usually
not possible to just supply a $dbh obtained elsewhere.
Note that connection information is class data, and that changing it at run
time may have unexpected behaviour for instances of the class already in
existence.
Original comment by saxjazm...@gmail.com
on 13 Sep 2011 at 5:38
Original comment by saxjazm...@gmail.com
on 5 Oct 2011 at 9:41
Original issue reported on code.google.com by
saxjazm...@gmail.com
on 12 Sep 2011 at 1:20