[DB-SIG] Towards a single parameter style
Daniel Dittmar
daniel.dittmar@sap.com
Mon, 17 Feb 2003 00:36:39 +0100
- those wanting to write portable programs find the multiple parameter
styles annoying
- those using only one driver have probably become fond of their current
style
To make it possible to support multiple styles in one driver, I propose
the following:
- connection.cursor () gets an optional keyword parameter 'paramstyle'
- connection has a writeable attribute which gives the default for this
parameter (or perhaps a mapping named 'cursorOptions', in case we want
to support more options)
Those wanting to switch to the 'standard' parameter style (whatever that
may be) will have to change only the part containing the connect, which
is driver specific anyway.
This might work for the current execute() discussion (keyword args vs.
dictionary) as well.
This does not mean that I propose that drivers should be required to
support more than one style.
Daniel Dittmar
--
Daniel Dittmar
SAP DB, SAP Labs Berlin
daniel.dittmar@sap.com
http://www.sapdb.org