[DB-SIG] DB API 1.1a3

M.-A. Lemburg mal@lemburg.com
Thu, 02 Jul 1998 10:10:20 +0200


Peter Godman wrote:
> 
> On Wed, 1 Jul 1998, Tod Olson wrote:
> 
> > >>>>> "M" == M -A Lemburg <mal@lemburg.com> writes:
> >
> > M> Tod Olson wrote:
> > >>
> > >> I notice that 1.1 no longer requires Connection objects to implement
> > >> all Cursor object attributes and methods.  Any reason?  I would like
> > >> the requirement to remain.
> >
> > M> Is anybody using this ? I think it's a better idea to provide a
> > M> dummy cursor object than having connection objects give access to
> > M> cursor methods and attributes: it makes porting applications a lot
> > M> easier. Database interfaces which do not really support cursors
> > M> could raise an exception if more than one cursor is being created.
> > M> But that's of course just my POV.
> >
> > But what about databases where connections and cursors really are
> > different?  That is, in Sybase you can submit SQL through either a
> > connection or a cursor, and that implies some meaningful difference to
> > the server.  Eg. some things are legal in a connection that aren't in
> > a cursor (don't ask for specifics, but we just saw an example two days
> > ago).
> >
> > Of course if no other database does this sort of thing, it probably
> > doesn't need to be reflected in the standard.
> 
> I feel it is important that it be in the standard, and would ask that if
> we want to get rid of one of the two interfaces, why not make it the
> cursor interface?

No, this wouldn't make sense in the general case.

Only Sybase seems to have a need for this feature, so dropping
it from the standard spec wouldn't hurt much, because

a) the sybase module may still implement these features on top
   of the API spec - it is no violation of the spec to *add*
   features

b) you are not likely to find another database that exposes the
   the same semantics as the ones you both described, so portability
   is no issue

c) you can always wrap connection objects with your own Python
   objects and these could then emulate the intended and expected
   behaviour

-- 
Marc-Andre Lemburg                               Y2000: 547 days left
---------------------------------------------------------------------
          : Python Pages >>> http://starship.skyport.net/~lemburg/  :
           ---------------------------------------------------------