[DB-SIG] what is the "correct" way to alter paramstyle in a PEP 249 interface?
by Vernon Cole other posts by this author
Sep 25 2009 5:45PM messages near this date
[DB-SIG] SQLObject 0.10.8
|
Re: [DB-SIG] what is the "correct" way to alter paramstyle in a PEP 249 interface?
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
Thread:
Vernon Cole
M.-A. Lemburg
|