On Tuesday 28 March 2006 08:09, Dmitry Vasiliev wrote: > > The getEncoding() approach isn't meaningful with database adapters that > > accept Unicode strings which is becoming the norm. The idea that database > > adapters will never be Unicode aware seems to have been embedded into Z3 > > quite deeply though :-( > > I guess the 'zope.app.rdb' code is somewhat in beta state so we still need > to figure out better approaches, interfaces, etc.
It is not beta, it just needs an update. I am going to support any cleanup in the area. > > I guess we can allow getEncoding() to return None > > for modern database drivers and make Z3 pass through queries as Unicode > > or ASCII strings to driver in this case. I'm going to want to make the > > switch to psycopg2 soon, and I think I'll need to sort this out in Z3 at > > that point. > > I think it would be better to add some additional method like > 'isUnicodeAware()' because 'getEncoding()' which returns None in the case > of unicode aware adapter seems hackish for me. This sounds good to me. > > I'm going to want to make the switch > > to psycopg2 soon, and I think I'll need to sort this out in Z3 at that > > point. I don't know yet if it will be better to maintain a single > > psycopgda or if it will be better to split it into two products. > > I think the single product would be better and more flexible approach, in > this case we can select better available underlying adapter at setup-time > or/and at run-time. > > By the way, what do you think about the idea of add DB-API2 compliant > exception hierarchy to 'zope.app.rdb'? Adapters will be responsible to > translate its exceptions to 'zope.app.rdb' exceptions. Sounds also good. It would be great if you two could work on a proposal. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training _______________________________________________ Zope3-dev mailing list Zope3email@example.com Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com