[DB-SIG] API 3.0 limiting paramstyle to ['named', 'qmark'] is okay. ('format' is not desirable)

Vernon D. Cole vernondcole at gmail.com
Fri May 17 17:01:29 CEST 2013


Good point, the others would be optional.

How should the switching be done?  My present development head has four
methods:

1) adodbapi.apibase.paramstyle = 'named'
I think this one should be deprecated.  Stepping on a module quasi-constant
is never a good idea.

2) adodbapi.connect(connection_string, paramstyle='named')
I just added this one, so a django adapter can hand me a bucketfull of
keyword arguments.  I think I like this the best in terms of ease-of-use.

3) conn = adodbapi.connect(connection_string)
   conn.paramstyle = 'named'
This is the most obvious, and provides lots of power.  The programmer could
use 'qmark' to load big INSERT statements, then switch to 'named' for
detailed SELECT or UPDATE.  The default value is determined by the module
author.

4) cursor.paramstyle = 'named'
I have this implemented, but the more I think about it, the more it seems
unnecessary.

What other options should be considered?
--
Vernon


On Fri, May 17, 2013 at 2:59 PM, Michael Bayer <mike_mp at zzzcomputing.com>wrote:

>
> On May 17, 2013, at 6:42 AM, M.-A. Lemburg <mal at egenix.com> wrote:
>
> > On 17.05.2013 12:09, Vernon D. Cole wrote:
> >> I short time ago I commented to this forum that the 'format' paramstyle
> was
> >> important to keep, because of widespread use, citing django as an
> example.
> >>
> >> I have taken the question to the django developers group and received a
> >> response that they don't really like the 'format' paramstyle and would
> be
> >> happy to have a reason to change.
> >>
> >> I therefor rescind my previous objection.
> >
> > psychopg2 uses the 'format' paramstyle and while I agree that
> > it has issues, I think the existing code base using
> > it is large enough that we cannot easily remove that
> > paramstyle :-(
> >
> > I'd love to hear what Daniele thinks about this.
>
> there's no reason a DBAPI can't keep a particular paramstyle, we just want
> to make it so that *all* DBAPIs definitely support "named" and "qmark".
>  The rest are just optional.
>
>
>
>
> >
> > --
> > Marc-Andre Lemburg
> > eGenix.com
> >
> > Professional Python Services directly from the Source  (#1, May 17 2013)
> >>>> Python Projects, Consulting and Support ...   http://www.egenix.com/
> >>>> mxODBC.Zope/Plone.Database.Adapter ...       http://zope.egenix.com/
> >>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
> > ________________________________________________________________________
> > 2013-05-07: Released mxODBC Zope DA 2.1.2 ...     http://egenix.com/go46
> > 2013-05-06: Released mxODBC 3.2.3 ...             http://egenix.com/go45
> >
> > ::::: Try our mxODBC.Connect Python Database Interface for free ! ::::::
> >
> >   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
> >    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
> >           Registered at Amtsgericht Duesseldorf: HRB 46611
> >               http://www.egenix.com/company/contact/
> > _______________________________________________
> > DB-SIG maillist  -  DB-SIG at python.org
> > http://mail.python.org/mailman/listinfo/db-sig
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/db-sig/attachments/20130517/37b88297/attachment-0001.html>


More information about the DB-SIG mailing list