Re: [DB-SIG] DBAPI 3.0: Unified parameter style

2014-12-28 Thread Vernon D. Cole
It happens that the statement "there is no reliable way to distinguish a mapping from a sequence" is not true. I submit the following example. Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] > on win > 32 > Type "help", "copyright", "credits" or "license" for more infor

Re: [DB-SIG] DBAPI 3.0: Unified parameter style

2014-12-27 Thread Dieter Maurer
Tony Locke wrote at 2013-9-13 18:54 +0100: > ... >I thought I'd give a suggestion for unified parameters. Apologies if >this has been suggested before, I did have a look at the archives :-) > >In DBAPI 2.0, the parameters to execute() can be a sequence or a >mapping. In DBAPI 3.0, the paramstyle at

Re: [DB-SIG] DBAPI 3.0: Unified parameter style

2013-09-22 Thread Tony Locke
Just for fun I've put up a version of pg8000 that works without a paramstyle parameter: https://github.com/tlocke/pg8000/tree/three In this version, you can do: execute("select * from emp where name = :1", ['horatio']) or: execute("select * from emp where name = :name", {'name': 'horatio'}) T

Re: [DB-SIG] DBAPI 3.0: Unified parameter style

2013-09-17 Thread Vernon D. Cole
Tony: I should also mention that the reason that "qmark" ("?") delimiters were selected as the choice for specified-by-order parameter markers, rather than "numeric" (":n") in simply popularity. Postgres is pretty much alone in using numeric, where several other popular databases all use qmark.

Re: [DB-SIG] DBAPI 3.0: Unified parameter style

2013-09-17 Thread Vernon D. Cole
Tony: You are not the first one to notice that .paramstyle is rather an obtuse and ungainly creature. I also submitted a suggestion that introspection of the second argument to exectute() could potentially make it nearly obsolete (when there are only two alternative choices). As you have see

Re: [DB-SIG] DBAPI 3.0: Unified parameter style

2013-09-17 Thread Christoph Zwerschke
Am 16.09.2013 09:51, schrieb M.-A. Lemburg: Perhaps I should update the page with a summary of what we've been discussing here. If you can find some time for it, that would be really helpful. -- Christoph ___ DB-SIG maillist - DB-SIG@python.org h

Re: [DB-SIG] DBAPI 3.0: Unified parameter style

2013-09-16 Thread M.-A. Lemburg
The wiki page is somewhat out of date and doesn't really reflect what we've been discussing here on the list recently. We're currently aiming for making the .paramstyle a user adjustable setting and requiring support for two paramstyles 'qmark' and 'named', while keeping the other paramstyles arou

[DB-SIG] DBAPI 3.0: Unified parameter style

2013-09-15 Thread Tony Locke
Hi, I'm a contributor to the PG8000 Postgres driver: https://github.com/mfenniak/pg8000/tree/py3 Having read the interesting DBAPI 3.0 wiki page: https://wiki.python.org/moin/DbApi3 I thought I'd give a suggestion for unified parameters. Apologies if this has been suggested before, I did have a