[DB-SIG] PEP249 - Proposed change to DB-API 2.0
chris@onca.catsden.net
chris@onca.catsden.net
Fri, 27 Apr 2001 13:58:56 -0700 (PDT)
Okay, if I understand correctly, there's more support for adding in
'optional' support for 'optionally' supporting more than one paramstyle.
Ie, in the next version of the DB-API, we could add:
----
In addition to the above 'required' interface, the Python API implementer
may choose to offer the following interface:
- include interface changes from my earlier post here -
----
Then, the /user/ of the API would have to check to see if the facilities
are available (ie, the presence of valid_paramstyles and set_paramstyle)
before attempting to use them.
My suggestion was to /require/ of a API implementor, if they want to make
their API compliant with DB-API 2.1 (or whatever we call it), to supply
the above interfaces, even if the only thing she does is to have a single
entry inside valid_paramstyles, and passing 'set_paramstyle' always throws
an exception if any other paramstyle is chosen.
I can see pros and cons on both sides:
Extension is Optional
---------------------
Pro: Very easy for the API implementor
Con: API user needs to write extra code to check
Pro: No problems caused if a 2.0 API is given to a 2.1 aware database APP
Extension is Required, even if Minimimally Implemented
------------------------------------------------------
Con: Many API's need to be modified to be 2.1 compliant (but the change is
trivial)
Pro: Less code change in the applications, unless you consder the code
change they'd go through to utilise the extension.
Given the above, I'd say that I too would support a 'optional'
implementation. Although, we do need to specifiy the requirements if any
API writer wants to implement this facility. Ie, "This is optional, but
if you do it, you must do it like this".
("`-/")_.-'"``-._ Ch'marr, a.k.a.
. . `; -._ )-;-,_`) Chris Cogdon <chmarr@furry.org.au>
(v_,)' _ )`-.\ ``-'
_.- _..-_/ / ((.' FC1.3: FFH3cmA+>++C++D++H++M++P++R++T+++WZ++Sm++
((,.-' ((,/ fL RLCT acl+++d++e+f+++h++i++++jp-sm++