I noticed in a recent post that there is an outstanding patch for Oracle for support of 'named' paramstyle.
I also found, during my morning's research on the question, that there has been at least one patch so that django will play nice with 'pyformat' paramstyle. I got involved with this entire question when I back-ported Adam Vandenberg's paramstyle conversion code into the development fork of adodbapi. It appeared to me, and seems to be widely believed in the community (enough so that I have stated it as a fact) that "django blindly expects 'format' paramstyle." Not only django-mssql, but also the sqlite adapter convert incoming queries from 'format' into 'qmark' before handing it off to the SQL engine. My revision to adodbapi permits the programmer to SET paramstyle (to one of 'named', 'qmark', or 'format') and the adapter does the conversion. The version now in development adds the capability of making that selection using a keyword argument to the 'connect' call. The patched version of the django-mssql back end just sets that keyword and goes on its merry way. Recent traffic on the Python database discussion list has floated the idea that it is time for an upgrade to PEP 249, making a new db-api version 3.0 with a new PEP. The consensus opinion is running toward paring the available paramstyle options down to two, and forcing adapter authors to support both. The two winners were 'qmark' and 'named'. My latest input to that effort was a plea that 'format' must be kept because of the widespread use of it in existing code -- and I specifically mentioned django. But was I wrong? I am not sure whether I am sounding a warning, or asking a question. If a programmer is using the ORM, the whole question of paramstyle confusion is unimportant -- the ORM takes care of it. To a programmer who makes raw SQL calls, it is all important. Do I make a parameter list, or a parameter dictionary? What is the feeling of this group? Should I maintain my activism that %s 'format' paramstyle be maintained into the future? Or should I be helping the django community to prepare for a new future where one must (or may?) choose between a parameter list with "?" or a parameter mapping with ":paramname"? Personally, I do not really like the '%s' style would be happy if it goes away. What do you think? -- Vernon Cole -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-developers?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
