ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> db-sig
db-sig
[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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved