[DB-SIG] PEP249 - Proposed change to DB-API 2.0

Dave Cole djc@object-craft.com.au
27 Apr 2001 10:53:31 +1000


>>>>> "Chris" == Chris Cogdon <chris@cogdon.org> writes:

Chris> There is a module-level variable, valid_paramstyles, that
Chris> containsthe list of all paramstyles the API code can support.

Chris> There is a new method on the connection object, set_paramstyle,
Chris> that indicates which paramstyle the calling code is going to
Chris> use. If the calling code sets a paramstyle that is not
Chris> supported, an exception is raised. The default paramstyle is
Chris> that specified in the existing 'paramstyle' variable. It is not
Chris> modified by calls to object.set_paramstyle.

Chris> There is a new module function, also called set_paramstyle,
Chris> that sets the 'default' paramstyle that is used when connection
Chris> objects are created. In this case, the module.paramstyle IS
Chris> modified. (Alternately, we could let code change the variable
Chris> module.paramstyle directly. Connection objects would throw an
Chris> exception if the default is not supported.)

Sybase only supports the ? place holder.

I am not sure how feasible this is, but maybe a (simple) SQL parser
could be used to support any placeholder style which would then be
transformed into the native style to interface with the database API.

- Dave

-- 
http://www.object-craft.com.au