Re: [mortis@voicenet.com: Re: [Pas-dev] Error.pm and Log::Dispatch/Log::Dispatch::Config]
Status: Beta
Brought to you by:
mortis
From: Kyle R . B. <mo...@vo...> - 2002-05-17 18:27:57
|
Excellent! Would you mind writing that up as a proposal and checking it in to the archive? > >>+1 for some kind of Base SQL object and have PostgreSQL & MySQL derive from it. > > > > > > Do you have any ideas for how to do this? If you do, write up a proposal > > on how to do it. > > First off, in the config file, remove all references to mysql in the pas.session > name space. ;) > > Looking at Org::Bgw::Pas::Session::MySQL::Factory: > > - All the constants can go in the parent object. > > - load_session_rec() should be able to go in the parent without having to be > overridden. Am I correct or making too much of an assumption? Just because I'm > not sure of the blob issues between Mysql, PostgreSQL, Oracle, etc. > > - store_session_rec() goes in the parent. > > - update_session_rec() becomes an abstract method in the parent. It must be > ovewritten. > > - insert_session_rec() will follow update_session_rec() lead. > > - update_atime_for_session_rec() goes in the parent(?). > > - db_hostname(), db_dbname(), db_table(), get_username(), get_password() all to > the parent class. > > - get_dsn() goes to the parent with one modification. We add an abstract method > namded db_driver() to the parent. db_driver() will return a constant value of > "mysql" or "Pg" or etc. in the child depending on the class. Unless the dns > syntax is that different from DB to DB. I guess it also depends on how > someone's configured their DB connections too. Either way, it's easy enough to > abstract to the children. And if we get the generic way to work, just put a > note in the docs of what to look for to override. > > Justin > -- ------------------------------------------------------------------------------ Wisdom and Compassion are inseparable. -- Christmas Humphreys mo...@vo... http://www.voicenet.com/~mortis ------------------------------------------------------------------------------ |