Re: [Pas-dev] Support for other DBs in the session
Status: Beta
Brought to you by:
mortis
From: Mental <me...@ne...> - 2002-05-28 20:39:35
|
On Tue, 2002-05-28 at 16:02, Justin Bedard wrote: > > Yes, and in your config file, you specify what child of these classes to > > use, correct? So you'd be setting > > pas.session.object=Org::Bgw::Pas::Session::Db::Pg or something right? > > Pretty much. Every so slightly different. Org::Bgw::Pas::Session::DB > determines the correct object to use by what's in the config file. Right now > it's reading the variable pas.session.db.driver from the config file. > A parent knowing about its children strikes me as bad. Shouldnt the config file tell pas what session object to use for sessions? Then pas instantiates a session of type N and uses it. > So you pas.session.object will only be valid for the following session types: > File, DB or Apache. So if you set pas.session.object to DB, the > pas.session.db.driver tells the application what kind of DB the session will be > connecting to. > I think we need 2 settings in the config, DB type (file, apache, rdb) and session type so that we use the right loader/storer stuff. > >>Small modifications to Org::Bgw::Pas::Session::DB and a new class of > >>Org::Bgw::Pas::Session::DB::mysql was all that was needed. > >> > >>And I guess I should write some unit tests before commiting. ;) I'd also like > >>to commit the Postgresql implementation at the same time. I have to remember > >>how to configure Postgresql. > > > > Actually, its not hard. And since its new, it doesnt matter. Just make > > sure you dont break mysql and commit what you have. I have postgres > > setup and can test/tweak and write tests for that piece if you want. Or > > I can create you an account on hades and you can do stuff there. > > What I meant by configuring is setting up users and then setting passwords & > privileges. It's been too long since I've used Postgresql. It's just a matter > of finding the right page in the manual. I've created a user, a database and > the pas_session table. I'm not sure if I have a password or the privileges > right yet. I may also need to upgrade to 7.1 or 7.2 (I'm running 7.0.3 right now). > That really depends. YOu can configure it so that anything that connects to the local box is trusted. This is independent of tcp connections. Its all in the user/admin guide. vi /etc/postgresql/pg_hba.conf > > The way I see this working is that we simply provide a way to get > > sessions working in the app. I dont see the DB layer ever doing anything > > more. Then developers can write their own page object in pas/pages (or > > wherever) that connects to their X database. They would derive from this > > OtherDatabase class for their other page objects. This is probably the > > most non-invasive/easist way to go. Sessions and other data dont even > > need to be in the same db at that point. Forgive me if I'm stating the > > obvious, but we may want to add some note to this effect in our docs if > > there isnt one already. > > I guess if we want to go this way, we'd need to change the config file parameter > to something closer to what you suggested. Then people can add the different DB > session classes outside the Org::Bgw namespace. > Why do they need to use our config file at all? And what would prevent them from adding an entry and using it as things stand now? > But I also think it would be good if we could provide support for as many > databases as possible (session & other wise). Then at least we can sound kewl > and can word salad people with large lists!! So should we have an Org::Bgw::Pas::Db object that you can use to get a generic_dbh? What if you have 5 different data sources? I think we should make it easy to extend after we get the session stuff sorted out. -- Mental (Me...@Ne...) |