Re: [Zope3-dev] Re: [Zope3-Users] ODBC database adapter for Zope3?

2005-09-13 Thread Chris Withers

Stephan Richter wrote:

Oh :-( That sucks. Is there a DBAPI sig for python that we should be
talking to about getting that fixed?


There is a sig and we could try. But I have *very* little hope that such a 
proposal would come to fruition. Most applications don't really care about 
supporting many DB backends. 


Waaagh :'(


2. Advanced DA implementations support much more datatype conversion than
the default database connection package.


Yes, but it's inconsistency between DAs on this front that causes
problems...


Well, the Python DB-API is even worse and does not even try to specify type 
returns. I agree, maybe we should create a recommendation for Zope 3 DB 
adapters.


*nods*


For example, a good DB adapter should always ensure
that all datetimes have pytz timezones associated with them.


Exactly, which is why that kind of stuff should be in a central place.
What happens if a DA DOESN'T do this when someone is expecting it to?
(the other common problematic type is that of an SQL NULL)



Well, I would love to see a draft on a Zope 3 DA standardization.


And I'd love to write one, but I still need to get to grips with the 
basics of Zope 3 first ;-)


Gimme a poke in a month or two!

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Re: [Zope3-Users] ODBC database adapter for Zope3?

2005-09-12 Thread Chris Withers

Benji York wrote:


I guess my comments come from seeing lots of different Zope 2 DAs 
where all the boilerplate of the DA, as opposed to the DB, has 
been copied between different DAs, and often implemented with varying 
degrees of incompetence and lack of maintenance ;-)


Perhaps a standard adapter for DB-API connection objects?


Yeah, I've often dreamed of writing just such a thing for Zope 2 ;-)

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Re: [Zope3-Users] ODBC database adapter for Zope3?

2005-09-12 Thread Chris Withers

Stephan Richter wrote:
1. Parse the DSN to the various DB package formats. One of the big problems of 
Python's DB API is that it does not specify a unified connection mechanism, 
while Zope 3 does, which is a very good thing.


Oh :-( That sucks. Is there a DBAPI sig for python that we should be 
talking to about getting that fixed?


2. Advanced DA implementations support much more datatype conversion than the 
default database connection package. 


Yes, but it's inconsistency between DAs on this front that causes 
problems...


For example, a good DB adapter should always ensure 
that all datetimes have pytz timezones associated with them. 


Exactly, which is why that kind of stuff should be in a central place. 
What happens if a DA DOESN'T do this when someone is expecting it to?

(the other common problematic type is that of an SQL NULL)

This in 
particular is a functionality a generic Python library cannot provide, since 
Python does not commit to a particular timezone implementation.


...more's the pity ;-)

That said, surely it'd be a good thing if all this stuff was in one 
place for Zope 3?


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Re: [Zope3-Users] ODBC database adapter for Zope3?

2005-09-08 Thread Chris Withers

Stephan Richter wrote:

On Wednesday 07 September 2005 08:41, Chris Withers wrote:


I know Zope 2 has the bizarre need for a dual Zope DA and Python DB
set of things, but do we have to support this pattern in Zope 3?

Is there any reason the Zope 3 RBD machinery can't just work with ANY
Python DBAPI 2.0 (or whatever..) compatible database library?


Yes, we have the need. We need the wrapper to correctly handle our 
transactions, so that if a RDB transaction is aborted, the ZODB/Zope 
transaction should also be aborted, etc.


OK, that's all well and good, but are you saying that Python's DBAPI 
doesn't have generic transaction hooks? If it doesn't, that seems like a 
deficiency that should be addressed in Python with a PEP.


If it does, then why don't we use those?

I guess my comments come from seeing lots of different Zope 2 DAs where 
all the boilerplate of the DA, as opposed to the DB, has been copied 
between different DAs, and often implemented with varying degrees of 
incompetence and lack of maintenance ;-)


If we can get all that stuff in one place, then we have a much better 
chance of making it as good as it should be, AND we make it possible to 
use any relational database which has a python library, rather than 
having ot wait for some poor unsuspecting code monkey to try and write 
the DA...


Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Re: [Zope3-Users] ODBC database adapter for Zope3?

2005-09-08 Thread Stephan Richter
On Thursday 08 September 2005 06:04, Chris Withers wrote:
 Is there any reason the Zope 3 RBD machinery can't just work with ANY
 Python DBAPI 2.0 (or whatever..) compatible database library?
 
  Yes, we have the need. We need the wrapper to correctly handle our
  transactions, so that if a RDB transaction is aborted, the ZODB/Zope
  transaction should also be aborted, etc.

Here are a couple more reasons:

1. Parse the DSN to the various DB package formats. One of the big problems of 
Python's DB API is that it does not specify a unified connection mechanism, 
while Zope 3 does, which is a very good thing.

2. Advanced DA implementations support much more datatype conversion than the 
default database connection package. This is particularly visible for the 
PstGreSQL DB Adapter. For example, a good DB adapter should always ensure 
that all datetimes have pytz timezones associated with them. This in 
particular is a functionality a generic Python library cannot provide, since 
Python does not commit to a particular timezone implementation.

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
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Re: [Zope3-Users] ODBC database adapter for Zope3?

2005-09-08 Thread Stephan Richter
On Thursday 08 September 2005 06:04, Chris Withers wrote:
 If we can get all that stuff in one place, then we have a much better
 chance of making it as good as it should be, AND we make it possible to
 use any relational database which has a python library, rather than
 having ot wait for some poor unsuspecting code monkey to try and write
 the DA...

A very simplistic DA is easy; you basically only have to write a function that 
uses the DSN value to construct connection arguments for a particular DB 
package. If you make advanced use of the DB, you also want to register type 
conversions.

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
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Re: [Zope3-Users] ODBC database adapter for Zope3?

2005-09-08 Thread Benji York

Chris Withers wrote:
I guess my comments come from seeing lots of different Zope 2 DAs where 
all the boilerplate of the DA, as opposed to the DB, has been copied 
between different DAs, and often implemented with varying degrees of 
incompetence and lack of maintenance ;-)


Perhaps a standard adapter for DB-API connection objects?
--
Benji York
Senior Software Engineer
Zope Corporation
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Re: [Zope3-Users] ODBC database adapter for Zope3?

2005-09-07 Thread Stephan Richter
On Wednesday 07 September 2005 08:41, Chris Withers wrote:
 I know Zope 2 has the bizarre need for a dual Zope DA and Python DB
 set of things, but do we have to support this pattern in Zope 3?

 Is there any reason the Zope 3 RBD machinery can't just work with ANY
 Python DBAPI 2.0 (or whatever..) compatible database library?

Yes, we have the need. We need the wrapper to correctly handle our 
transactions, so that if a RDB transaction is aborted, the ZODB/Zope 
transaction should also be aborted, etc.

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
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com