[DB-SIG] what is the "correct" way to alter paramstyle in a PEP 249 interface?

Vernon Cole vernondcole at gmail.com
Sat Sep 26 02:45:13 CEST 2009


I am planning to add, as an extension, the ability for adodbapi to change
its paramstyle.  I personally like "named" much better than "qmark", and it
happens that django expects to have "format", so I will add that, too.

My question is, what would be an appropriate way to specify the altered
paramstyle?

1) As an attribute of the connection:
    con = adodbapi.connect('spam eggs")
    con.paramstyle = "named"

2) Make the module global mutable:
   adodbapi.adodbapi.paramstyle = "named"  # [ ick! ]

3) As a named parameter of the connection:
  con = adodbapi.connect("spam eggs", paramstyle="named")

Has anyone else done this?
How did they do it?
How will some speculated future db-api version 3.0 want it?
--
Vernon Cole
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/db-sig/attachments/20090925/57eeb468/attachment.htm>


More information about the DB-SIG mailing list